Jun 16, 2011, 8:15 PM
TreePanel remote mode AppendChild
Hello, how do I call the RemoteAppend passing an array of nodes?
My TreePanel is set mode="remote" and i have the Listner BeforeNodeDrop.
After call TreePanel1.appendChildRequest method the remote_append method in server-side not fires, because occurs an error. "node.parentNode is undefined - ext.axd?v=36328 (line 751)"
My question is, i can call remote_append passing more then one node at once? Or i can only pass one by one?
Thanks!
My TreePanel is set mode="remote" and i have the Listner BeforeNodeDrop.
var beforenodedrop = function (e) {
if (Ext.isArray(e.data.selections)) {
e.cancel = true;
e.dropStatus = true;
e.dropNode = [];
var rec;
var childNodes = [];
for (var i = 0; i < e.data.selections.length; i++) {
rec = e.data.selections[i];
var parentNode = e.tree.getNodeById(e.target.id);
var childNode = new Ext.tree.TreeNode({ nodeid: rec.get("itemID"),
text: rec.get("itemDescricao"),
leaf: true,
iconCls: "icon-bulletblue",
draggable: true,
allowchildren: false,
editable: false,
expandable: false,
isRoot: false,
isNode: false
});
e.dropNode.push(childNode);
parentNode.expand(false, false);
parentNode.appendChild(childNode);
childNodes.push(childNode); ---> Here i insert the childNode in the array
}
TreePanel1.appendChildRequest(childNodes, "append"); ---> Here i pass the array of childNodes to appendChildRequest
return true;
}
};
After call TreePanel1.appendChildRequest method the remote_append method in server-side not fires, because occurs an error. "node.parentNode is undefined - ext.axd?v=36328 (line 751)"
My question is, i can call remote_append passing more then one node at once? Or i can only pass one by one?
Thanks!