Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by zhu on Oct 20, 2008 11:27
open dhtmlx forum
get all checked ids when use dynamical xml loading

hi all ,
i have made a simple test by using denamic xml loading . the following is my code :

<div id="orgBox" style="text-align: left;width:98%;height:98%;float:left;clear:none;position:relative;overflow:visible;"></div>
<script>
var org_tree=new dhtmlXTreeObject(document.getElementById('orgBox'),"100%","100%",0);
org_tree.setImagePath("${CONTEXTPATH}"+"imgs/");
org_tree.enableIEImageFix(true);
org_tree.enableCheckBoxes(true);
org_tree.enableDragAndDrop(false);
org_tree.enableCheckBoxes(1);
org_tree.enableThreeStateCheckboxes(true);
org_tree.attachEvent("onCheck",onNodeSelect)
function onNodeSelect(nodeId){
org_tree.openAllItems(nodeId);
var info = org_tree.getAllCheckedBranches();
//alert(info);
//alert(org_tree.getAllSubItems(nodeId));
document.getElementById("users[0].orgId").value = info ;
}
org_tree.attachEvent("onOpenStart", function (id, state) {
     if(state == '0')
     {
     org_tree.setItemImage(id, 'folderOpen.gif','loading.gif');
     }
     if(state =='1')
     {
     org_tree.setItemImage(id, 'folderOpen.gif','folderClosed.gif');
     }
     return true;
});
//load xml stream from servlet (init tree)
org_tree.setXMLAutoLoading("${COM_FSTECH_MESSAGEHANDLE.web_UrlPrefix}"+"ajax/orgTreeList.do?TYPE=1000");
//dynamic load xml data
org_tree.loadXML("${COM_FSTECH_MESSAGEHANDLE.web_UrlPrefix}"+"ajax/orgTreeList.do?TYPE=1000");
</script>

the example tree looked like this :
item-0 |
|
| item-1-0 -------
| | item-2-0
| |
|
|
| item-1-1

when i checked 'item-0' ,i can only get 'item-0,item-1-0,item-1-1' but no 'item-2-0' .is there anyone could help me to resolve this problem ?

Answer posted by Support on Oct 21, 2008 02:51
Grid's methods operate only with loaded items.

So, getAllChecked returns ids of all checked  items (loaded items).