Dec 26, 2010, 11:13 PM
Dynamically Add TreePanel Node on codebehind
Hi,
I see that at treepanel loader examples, loading operation is fired from client side.
I have a treepanel and a FileUploadField which is in a form (https://examples1.ext.net/#/Form/FileUploadField/Basic/).
When save button is pressed i change the selected node, and want to add new nodes to this selected node at code behind.
I need to fire loading operation at server side.
I do some db operations and if success, want to add a node to treepanel's selectednode.
I see that at treepanel loader examples, loading operation is fired from client side.
I have a treepanel and a FileUploadField which is in a form (https://examples1.ext.net/#/Form/FileUploadField/Basic/).
When save button is pressed i change the selected node, and want to add new nodes to this selected node at code behind.
I need to fire loading operation at server side.
I do some db operations and if success, want to add a node to treepanel's selectednode.
Ext.Net.TreeNodeCollection nodes = new Ext.Net.TreeNodeCollection();
nodes.Add(new Ext.Net.TreeNode("p1", "picture Name", Icon.PictureLink));
X.Js.AddScript("#{TreePanel1}.getSelectionModel().getSelectedNode().loadNodes(eval(\"(" + nodes.ToJson() + ")\"));");
what is the problem with this code?Any idea? thanks