Hi,
I have a WebData Tree panel and details panel on the page. On SelectionChange event post back is happening and details of the node get populated from the server, but if node details are changed and another node is selected, I want to cancel SelectionChanged event. Drag/Drop is enabled, so when I cancel event during SelectionChanging, SelectionChanged is still called and new tree node stays selected and tree behaves as if it in the middle of drag/drop. So cancel does not wwork properly. Is it possible to cancel On SelectionChange event?
="hierarchyTree_OnNodeSelectionChanged"
="true"/>
/>
>
{
...
ret = ConfirmChanges(
false);
oDataTransfer.set_cancel(
true);
//or
tree._events.SelectionChanged.set_cancel(true);
tree.CancelPostBack = true;
oDataTransfer.cancel = true;
return false;
}
Todor,
Rather than uploading our webapp, I went ahead and created a simpler version.
When I run this app and click on a node, a prompt asks me if I want to continue. If I click on 'Cance', the POSTBACK stops as intended. If I click on 'OK', the POSTBACK continues as it should. However, once if I click on any nodes and I try cancelling the POSTBACK by clicking on 'Cancel', the POSTBACK continues!! Why? What am I doing wrong in this app?? Thanks for your help.
<%
%>
<!
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
="server">
tvwDevices_BeforeNodeSelectionChange() {
;
)
);
(confirmLeave) {
//parent.needtoSave(false);
//parent.needtoSave(true);
//true cancels postback
</
="width: 100%; height: 750px;">
="100%">
="PreviousPane">
="140px">
="Root Node">
="_content">
="width: 100%; height: 100%; border: none 0px;
margin: 0px; padding: 0px;"
In the post above you said that you have two trees one with working canceling function and other with not working. Could you paste both the working and not working code? And did from where you use needtoSave GetNeedToSave();, methods, because at least in IE8, while looking in IE Dev, there is no methods named like this? and if you define them somewhere else, please just post and the code for them.
Thanks
Todor-
In my aspx code, I have an ultrawebtree:
<ignav:UltraWebTree ID="tvwDevices" runat="server" DefaultImage="" LoadOnDemand="ManualSmartCallbacks"
HiliteClass="" HoverClass="" Indentation="20" EnableViewState="False">
<AutoPostBackFlags NodeChanged="True" />
<ClientSideEvents BeforeNodeSelectionChange="tvwDevices_BeforeNodeSelectionChange"/>
</ignav:UltraWebTree>
The script to stop the POSTBACK:
function tvwDevices_BeforeNodeSelectionChange(treeId, oldNodeId, newNodeId){
var changesMade = parent.GetNeedToSave(); // check to see if anything has changed.
if (changesMade == 'true')
var confirmLeave = window.confirm("You have unsaved changes. \n \n Are you sure you want to continue?");
if (confirmLeave) {
parent.needtoSave(false);
else {
parent.needtoSave(true);
return true; //true cancels postback
I am following the examples online that show the CSOM code. For some reason, the page still perform a POSTBACK.
Thanks for your help.
As soon as you post the code you are using to cancel both ultrawebtrees to cancel their post back - I can try to help you
Thanks,
Todor -
Thanks for your response. I made a mistake when I posted to this question. The problem I am having is with the 'UltraWebTree' not cancelling the postback and not the 'WebDataTree'. I have two ultrawebtrees. And one cancels the postback and one does not. Can you point me in the right direction to try to get this resolved? Thanks.