Hi,
We are currently in process of upgrading our application from Infragistics 3.5 version 10.3 to Infragistics 3.5 version 12.2. Currently I'm having trouble with canceling post back on client side when user expands node. In older version when page was loaded for first time, tree was populated with root node and root’s first level children. When one of the child nodes was expanded, NodeExpanded client and server side events were triggered. In client event we would check if node has children and if it has children we would cancel post back. If node didn’t have children post back would occur and server side NodeExpanded event would occur where we would append children to that node.
This is a javascript code for older version which am I trying to replicate
function OnNodeExpand(treeId, nodeId)
{
var tree = igtree_getTreeById(treeId);
if (tree == null || tree.CancelPostBack == null)
return;
var node = igtree_getNodeById(nodeId);
if (node != null)
var child = node.getFirstChild();
if (child != null)
var tag = child.getTag();
if (tag != null)
tree.CancelPostBack = true;
}
Is there any way to control AutoPostBackFlags NodeExpanded on client side for WebDataTree control?
Hello Hongguang,
You can disable autopostback for the nodeexpanded event and do manual postback when the parent does not have children like below:
__doPostBack(sender._id, "NodeExpanded" + (args._getPostArgs ? args._getPostArgs() : ''));
Please let me know if I can provide any further assistance.
This cancels expand event and I want to cancel post back event. Post back event occurs every time node is expanded, and I want that post occurs only when expanded node doesn't have any real children. We programmatically add child nodes on server side when. When page is loaded for first time, we add root node together with it's children and we check if every child node has children so we add empty node to indicate that node can be expanded. When user expands node, first on client side we check does node already have its children loaded, if it does we cancel post back even, if it doesn't we execute post back and add child nodes.
Hello dmcmichael,
You can cancel the postback by canceling the NodeExpanded client side event
eventArgs.set_cancel(true);
Please let me know if I can provide any further assistance regarding this matter