Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by shadowxkimo on Dec 05, 2007 23:09
open dhtmlx forum
About openItemsDynamic function

After specify function called while click event raised and use openItemsDynamic(list,true) to open dhtmlXTree dynamicly.
I predict that function will be called one time while openItemsDynamic() executed, since openItemsDynamic() will raise click event at last item.But, in fact, function will be called several times. Why? How should I let function will be called just one time after openItemsDynamic() executed ?
Answer posted by Support on Dec 06, 2007 03:02
Which version of dhtmlxtree do you use?
In latest version ( dhtmlxtree 1.5 ) the "onClick" event raized only for lats item in line ( other events, such as onOpen can be raized multiple times)
Please beware that if you have "selected" or "call" attribute for items in XML loaded for intermediate items - onClick event can be raized for them as well.
If you just need to catch moment when operation cancelled ( only in latest build ) you can use
    tree.attachEvent("onOpenDynamicEnd",function(){
       //called after all items opened
    })