jeudi 23 juillet 2015

How to prevent Checked event by confirm box on radtreeview?

I have a radtreeview with checkbox. When I check the checkbox, I want to prevent checked event by clicking 'cancel' on confirm box but it doesnt work. Here is my code:

<telerik:RadTreeView ID="_tree" runat="server" Skin="Silk" CheckBoxes="true" OnClientNodeChecking='ClientNodeChecking' TriStateCheckBoxes="true" CheckChildNodes="true"></telerik:RadTreeView>

function ClientNodeChecking(sender, eventArgs) {
        var node = eventArgs.get_node();
        if (node.get_checked()) {
            var agree = confirm('Do you want to check?');
            if (agree) {
                node.check();
            }
            else
                return false;
        }
    }



Aucun commentaire:

Enregistrer un commentaire