jmakeig
14 Jan 2007, 9:12 PM
I've got a tree that loads editable data for each node. I need to be able to intercept the change selection event and ask the user to save her changes before the selection actually takes place.
The closest I've found is the following:
YAHOO.ext.util.Observable.capture(tree.getSelectionModel(), this._handleBeforeTreeSelection, this);
_handleBeforeTreeSelection: function(eventName, tree, node) {
if(eventName == 'selectionchange') {
return window.confirm('Are you sure?');
return true;
}
}
I'm able to intercept the loading of the destination node, but the UI still shows it as selected. Does anyone have any better ideas how to properly capture and cancel node selection?
Thanks.
The closest I've found is the following:
YAHOO.ext.util.Observable.capture(tree.getSelectionModel(), this._handleBeforeTreeSelection, this);
_handleBeforeTreeSelection: function(eventName, tree, node) {
if(eventName == 'selectionchange') {
return window.confirm('Are you sure?');
return true;
}
}
I'm able to intercept the loading of the destination node, but the UI still shows it as selected. Does anyone have any better ideas how to properly capture and cancel node selection?
Thanks.