Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted on Aug 28, 2009 02:10
open dhtmlx forum
how to add new Item to dhtmlxFolder ?

Hi,

I want to add a new folder (item) to dhtmlxFolder div after successfully loading XML. how can i do that?
I come to know that there is method named addItem=function (id, itemObj, pos). So what parameter value i have to supply.

Thanks,
Answer posted by Alex (support) on Aug 28, 2009 07:20

Hello,

unfortunately, folders doesn't provide public method to add separate item.

You can use loadJSON(json_object) or loadXMLString(xml_string) method. For example:

h = folders.attachEvent("onXLE",function(){
  folders.detachEvent(h)
  folders.loadXMLString("<data><item id='new_id' name='New Item' type='dir'/></data>");
 
});

folders.loadXML(...)