Problem in Multiselect in DHTMLXtree on Loading

Hi,

I am facing problem with MultiSelect. It works fine when user selects multiple items on tree and getting selected values using “getSelectedItemId” function. But I am not select multiple on load, I am doing it by adding select=‘1’ attribute in few items in XML and enabled multiselection before loading XML. It is only selecting last item which I marked as selected. Please let me know if I am doing anything wrong.

TIA.
Regards, Prady

Hi,

it’s possible to select only one node by the select=“1” attribute.

You may use selectItem(itemId,false,true) to select multiple nodes. The items those should be selected you may define in the userdata tag:

[code]
id1,id2,id3

tree.loadXML(url,function(){
var ids = tree.getUserData(0,“selected”);
var arr = ids.split(",");
for(var i=0;i <arr.length;i++)
tree.selectItem(arr[i],false,true);
})[/code]

It worked… :slight_smile: Thank you so much Alexandra

Regards,
Prady