我有一个带有复选框的radtreeview。当我勾选复选框时,我想通过点击“取消”来阻止检查事件。在确认框但它不起作用。这是我的代码:
<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;
}
}
&#13;
答案 0 :(得分:0)
我找到了解决方案。使用OnClientNodeChecked:
function ClientNodeChecked(sender, eventArgs) {
var node = eventArgs.get_node();
if (!node.get_checked()) {
var agree = confirm('Do you want to check?');
if (!agree) node.check();
}
}
&#13;