Hi,
I am programatically creating nodes on a web tree using Javascript and I would like to simulate the node being clicked after it is created so as to cause the appropriate client side event handler to be called, then the postback to occur and the server side event handler to be called.
I've tried doing this by setting the node to be selected then calling oNode.WebTree.Element.click() since it seems as though it's only the tree DIV element which has any onclick handlers. Unfortunately this has no effect.
Hope you can help.
Thanks,
Stuart
Hi!
I dig into Infragistics javascripts file... And I find out a way to achieve your needs... :)
This is something ugly because if infragistics changes its implementation (in a future version) this code may fail:
var oNode = oTree.insertRoot(0, "popo"); //Insert the new node
oNode.getElement().getElementsByTagName("span")[0].click(); //Execute click in the rigth html element
I tried this with a simple tree without images and checkboxes. I don't know if setting some UltraWebtree properties the render may be something diferent, with more spans that will cause a fail.
Bye,
Carlos Marcão
Hey Carlos,
That worked perfectly! Thanks very much for your help.
I understand the point about about it being closely coupled to the implmentation, but I can live with that for now. Hopefully Infragistics could supply us with an oNode.click() method.
Cheers,