How do you get the old WebDataTree node text value in the TextChanged event? In other words, a user edits the text of a WebDataTree node and presses Enter. The TextChanged event fires, and I need to know the previous text value of the DataTreeNode before the change was made. How can you get that in the event?
Hi raywhite,
Thank you for posting in our forums!
You can get the old text of a node during the TextChanging event. Once the TextChanging event returns and if the event was not cancelled, the node's text will get updated. If it is not required to check the old text during the TextChanged event, I would recommend handling it during the TextChanging event.
You can use the following code to store the old text during textChanging and then access it during textChanged.
var oldText = null; function WebDataTree1_NodeEditingTextChanging(sender, eventArgs) { oldText = eventArgs.getNode().get_text(); } function WebDataTree1_NodeEditingTextChanged(sender, eventArgs) { if (oldText != null) { console.log(oldText); oldText = null; } }
If you need further assistance with this, please let me know.
Hello raywhite,
Please let me know if you have any other questions or concerns about this issue and I'll be glad to help you.