Hi
My tree control handles the NodeExpand event on the server. It also handles the client NodeExpanding event.
If the user clicks the expand icon on a tree node, I thought it would be efficient to check on the client side to see whether I have already got child nodes. If I have child nodes then there is no need to do a postback. However, I do still want the node to expand as the client has all the node data.
My problem is - How do I cancel the postback, but allow the node to expand?
Thanks,
Martin
| function onClientNodeExpanding(sender, args) |
| { |
| var childrencount = args.get_node().get_nodes().get_count(); |
| if (childrencount > 0) |
| { |
| //don't cause a post back as we already have the children. However, we do actually want to expand |
| args.set_cancel(true); |
| } |
| } |