PDA

View Full Version : [CLOSED] TreeEdtior.cancelEdit does not revert to old value



gr_great_2000
11 Jun 2010, 5:43 AM
In the following piece of code

// Change the text of a tree node
function updateHandler(editor, newVal, oldVal) {
var node = editor.editNode;
if (newVal == '') {
Ext.Msg.alert('Update failure', 'Empty values are not allowed');
// THE FOLLOWING LINE BEHAVES AS EXPECTED
editor.cancelEdit(true);
} else if (newVal != oldVal) {
Ext.Ajax.request({
url: 'update_node.php',
failure: function() {
Ext.Msg.alert('Update failure', 'Error: Updating the database failed');
// DOES NOT REVERT TO THE OLD VALUE
editor.cancelEdit(true);
}
});
}
}

The first call to editor.cancelEdit works fine, while the second does not. In the latter case, the old value is not reverted. Upon request, I can provide with a URL to demonstrate this problem.

Please forgive me if this is not actually a bug, but I am relatively new to Extjs.

Kind regards
George

Jamie Avins
11 Jun 2010, 8:48 AM
Please try to follow to guidelines for posting to the bug forum: http://www.extjs.com/forum/showthread.php?71015-Posting-to-the-Bug-Forum