using SmartClient 8.3
I'm trying to implement this function in a TreeGrid to prevent removal of a node if the node is a folder (has child nodes):
Problem is, in my example code above, it always executes the code in my if block regardless of whether the node is a leaf or has children.
So, I have two questions:
1. What am I doing wrong with my client side code?
2. How would I go about preventing deletion of a node with child nodes via some bit of magic in my server side data source declaration? I suspect I would put something in the "remove" operationBinding, but need help on what that would look like.
Thanks for any help!
Jerry
I'm trying to implement this function in a TreeGrid to prevent removal of a node if the node is a folder (has child nodes):
Code:
removeSelectedNodeIfNoChildrenExist: function(data, node) {
if (this.data.isLeaf(node)) {
isc.say("huh");
//this.removeSelectedData();
}
}
So, I have two questions:
1. What am I doing wrong with my client side code?
2. How would I go about preventing deletion of a node with child nodes via some bit of magic in my server side data source declaration? I suspect I would put something in the "remove" operationBinding, but need help on what that would look like.
Thanks for any help!
Jerry
Comment