我需要显示我的类别的树视图,保存在我的mysql数据库中.
数据库表:
桌子:猫:
列:id,name,parent问题在php部分:
//function to build tree menu from db table test1
function tree_set($index)
{
global $menu;
$q=mysql_query("select * from cats where parent='$index'");
if(!mysql_num_rows($q))
return;
$menu .= '<ul>'."\n";
while($arr=mysql_fetch_assoc($q))
{
$menu .= '<li>';
$menu .= '<span class="file">'.$arr['name'].'</span>';//you can add another output there
$menu .=tree_set("".$arr['id']."");
$menu .= '</li>'."\n";
}
$menu.= '</ul>'."\n";
return $menu;
}
//variable $menu must be defined before the function call
$menu = '
<link rel="stylesheet" href="modules/Topics/includes/jquery.treeview.css" />
<script src="modules/Topics/includes/lib/jquery.cookie.js" type="text/javascript"></script>
<script src="modules/Topics/includes/jquery.treeview.js" type="text/javascript"></script>
<script type="text/javascript" …Run Code Online (Sandbox Code Playgroud) 我的Gridview模板列中有checkBoxes,名为"Category A"和"Category B".我想要Select-All功能,即当用户检查A类列中的Select-All复选框时,必须在该列下检查所有复选框.类别B也是如此.我正在尝试使用下面的代码.我的代码的问题是,它选择整个gridview中的所有复选框,"Category A"以及"Category B"复选框.但是,我只希望在同一列下选中复选框.
function SelectAllCheckboxesA(chk) {
$('#<%=gvSurveys.ClientID %>').find("input:checkbox").each(function() {
if (this != chk) {
if ($(this).hasClass('CatA') != false) {
this.checked = chk.checked;
}
}
else {
alert($(this));
}
});
}
<asp:GridView ID="gvSurveys" runat="server" AutoGenerateColumns="false" AllowSorting="True" Width="1500px">
<Columns>
<asp:TemplateField>
<HeaderTemplate>Category A
<asp:CheckBox ID="chkSelectAllCatA" runat="server" Visible="false" onclick="javascript:SelectAllCheckboxesA(this);" CssClass="SACatA" />
</HeaderTemplate>
<ItemTemplate>
<asp:CheckBox ID="chkCatA" runat="server" Enabled="false" CssClass="CatA" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
Category B
<asp:CheckBox ID="chkSelectAllCatB" runat="server" Visible="false" CssClass="CatB" onclick="javascript:SelectAllCheckboxesB(this);" />
</HeaderTemplate>
<ItemTemplate>
<asp:CheckBox ID="chkCatB" runat="server" Enabled="false" />
</ItemTemplate>
</asp:TemplateField>
</Columns> …Run Code Online (Sandbox Code Playgroud) 是否存在函数参数中的(高度,宽度)顺序或显示尺寸时的约定?
有人可以解释一下has_many:through和has_and_belongs_to_many之间的利弊吗?
如果我有一个时间戳形式:yyyy-mm-dd hh:mm:ss:mmm
如何从时间戳中提取日期?
例如,如果时间戳显示为:"2010-05-18 08:36:52:236",从中获取2010-05-18的最佳方法是什么.
我要做的是隔离时间戳的日期部分,定义它创建新时间戳的自定义时间.是否有更有效的方法来定义时间戳的时间而不先取出日期,然后添加新的时间?
我现在是一名PHP程序员,我儿时的梦想之一就是创造一个游戏.
问题是我不知道Flash.我不擅长画画,甚至不艺术.我可以使用JavaScript进行一些编程,我可以认为自己是JQuery的中间人.
我如何开始使用Flash游戏开发?我先读了哪些书?
游戏的类型是关于印第安纳琼斯类型的角色的侧卷轴,并且设置在丛林中,树木和蛇以及许多动物.
我正在尝试使用标准ADO.NET API - DbConnection.GetSchema调用获取Oracle包中声明的过程的存储过程元数据(过程名称,参数类型,参数名称等).我正在使用ODP驱动程序.
我看到Package列在'Packages'和'PackageBodies'元数据集合中.过程参数显示在"参数"和"过程参数"集合中.我没有看到通过包元数据获取过程信息的方法.即使该过程没有任何参数,此过程的"ProcedureParameters"集合中也有一行.
我的问题:要获取过程元数据,我是否必须查询'ProcedureParameters'集合并搜索具有所需包名称的条目?然后,我可以根据参数信息构建过程元数据.是否有更短或更快的方式来获取相同的信息?
我想写一个简单的应用程序,需要在乐谱上显示音符(音乐人员的音符).它不是用于编写音乐符号软件,而是用于以只读模式显示员工的一些注释.我当然可以将图像作为背景,空白的工作人员并画出笔记......但当然这需要时间.
有合适的VCL组件吗?
当然,越丰富越好,无论如何即使是一个接一个地显示音符的基本组件就足够了.如果TMusicStaff的一个实例被称为MyMusicStaff,我可以用这种方式为它添加注释:
MyMusicStaff.Add([G4,F4,D4])
Run Code Online (Sandbox Code Playgroud)
(当然在Add方法中我没有指定持续时间,或者如果它们是和弦或旋律方式,它只是给出一个想法).
我想我表达了自己.
为了在文件中搜索字符串并将匹配字符串的行写入另一个文件,对于70MB(压缩状态)的单个zip文件,需要15-20分钟.有没有办法减少它.
我的源代码:
获取Zip文件条目
zipFile = new ZipFile(source_file_name);
entries = zipFile.entries();
while (entries.hasMoreElements())
{ ZipEntry entry = (ZipEntry)entries.nextElement();
if (entry.isDirectory())
{
continue;
}
searchString(Thread.currentThread(),entry.getName(), new BufferedInputStream (zipFile.getInputStream(entry)), Out_File, search_string, stats); }
zipFile.close();
Run Code Online (Sandbox Code Playgroud)
搜索字符串
public void searchString(Thread CThread, String Source_File, BufferedInputStream in, File outfile, String search, String stats) throws IOException
{
int count = 0;
int countw = 0;
int countl = 0;
String s;
String[] str;
BufferedReader br2 = new BufferedReader(new InputStreamReader(in));
System.out.println(CThread.currentThread());
while ((s = br2.readLine()) != null)
{
str …Run Code Online (Sandbox Code Playgroud) 我通常使用CSS规则margin:0 auto和960容器作为基于标准浏览器的内容,但我是HTML电子邮件创建的新手,我有以下设计,我现在想要在浏览器窗口中居中,而不使用标准CSS .
http://static.helpcurenow.org/mockups/emails/2010/may-survey/survey.html
我似乎记得在某个地方看到它也可以通过将你的电子邮件表设计包装在一个外部表设置为width:100%并text-align:center在tbody或类似的东西上使用一些内联样式来实现它?
这是最好的做法吗?
jquery ×2
actionscript ×1
activerecord ×1
ado.net ×1
asp.net ×1
bitmap ×1
c# ×1
conventions ×1
css-tables ×1
delphi ×1
dimensions ×1
file-io ×1
flash ×1
html-email ×1
java ×1
javascript ×1
metadata ×1
mysql ×1
oracle ×1
packages ×1
php ×1
ruby ×1
sql ×1
timestamp ×1