gigaZhang / struts2-jquery

Automatically exported from code.google.com/p/struts2-jquery
0 stars 0 forks source link

how to set the treenode checkbox is checked or unchecked by js? #909

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
jsp:

$("input:checkbox").removeAttr("checked");//I wonder set all checkbox 
unchecked,but failed
$.each( data.itemMenus, function(index, content)
 { 
    $("input:checkbox").each(function(index,value){
        if($(this).val()==content.id)
        {
            //alert($(this).attr("checked"));
            $(this).attr("checked",true);//I wonder set this treenode checkbox checked,but failed

            //alert($(this).attr("checked"));
                                }
    });
 }
);

mytree:
<s:url var="treeDataUrl" action="getAllTreeNodes" />
<sjt:tree 
    jstreetheme="default"
    id="jsonTree" 
    label="menuName"
    name="menuName"
    href="%{treeDataUrl}" 
    checkbox="true">
</sjt:tree>

so,how to do it, thanks!

struts2-jquery-tree-plugin-3.4.0.jar

Original issue reported on code.google.com by anhaiyin...@yahoo.com.cn on 25 Oct 2012 at 1:01

GoogleCodeExporter commented 9 years ago
When do you execute your scripts? Maybe you should subscribe it as an topic and 
execute it into an onCompleteTopics. Else your Script is maybe executed before 
your Tree is rendered.

Original comment by johgep on 31 Oct 2012 at 12:23

GoogleCodeExporter commented 9 years ago

Original comment by johgep on 22 Nov 2012 at 8:54