【发布时间】:2011-10-17 23:54:14
【问题描述】:
有没有办法在 Treeview 中使用 jquery 对话框模式而不是 javascript 确认消息?当用户将一个节点拖到树上的另一个节点时,我正在执行客户端事件“OnClientNodeDropping”,我想要做的是显示一个 jquery 对话框,要求用户确认移动。我希望模态对话框的“确定”和“取消”按钮将值传递给 args.set_cancel(dialog_result);当我尝试此操作时,页面会在对话框返回 true 或 false 确认之前执行。如何将旧学校确认换成 jquery 模态对话框
function OnNodeDropped(sender, args) {
var srcNode = args.get_sourceNode();
var destNode = args.get_destNode();
var dNode = destNode._contentElement.innerHTML.indexOf("inActiveCategory");
if (dNode >= 0) {
//Call a modal dialog here and return true of false instead of using the old school confirm
var result = confirm("This category is inactive. Moving to " + destNode.get_text() + " will set " + srcNode.get_text() + " to inactive as well! ");
//get the return value from the dialog, is it canceled or ok
args.set_cancel(dialog_result);
}
}
【问题讨论】:
标签: jquery treeview telerik modal-dialog