Home - Forums-.NET - FlyTreeView (ASP.NET) - Unable to stop post back

FlyTreeView (ASP.NET)

Technical support and KB related to the FlyTreeView control

This forum related to following products: FlyTreeView for ASP.NET

Unable to stop post back
Link Posted: 27-Feb-2008 22:28
I am using a context menu with flytreeview. The context menu contain an item for delete node.

function DeleteNode(item, argument) {
                        var node = argument;
                        if (confirm("Are you sure want to delete node " + node.getText() ))
                        {
                            node.remove();
                        }
                        else{return false}
                    }


Whenever I try to delete a node it works fine but when I cancel the deletion of node. Irrespective of that cancellation postback occurs.
How can i disable postback on cancellation of deletion of node
Link Posted: 28-Feb-2008 03:13
You can try the setAutoPostBack function of the CFlyMenuItem :
function DeleteNode(item, argument) {
    var node = argument;
    if (confirm("Are you sure want to delete node " + node.getValue()))
    {
        node.remove();                            
        item.setAutoPostBack(true);
    }
}
Link Posted: 28-Feb-2008 18:19
Thanks that works, but I have tried differently like this


function DeleteNode(item, argument) {
                        var node = argument;
                        if (confirm(" Are you sure to delete node? \n" +
                                    node.getText() ))
                        {
                            node.remove();
                            item.setAutoPostBack(true);
                        }
                        else
                        {
                        item.setAutoPostBack(false);
                        }
                    }