2
我目前使用JSON作爲使加載我DYNA樹:敦南樹AJAX負荷回調
$(document).ready(function() {
// Loads tree
$("#TreeManGrp").dynatree({
initAjax: {
url: "/Terminals/Refresh/"
},
onActivate: function (node) {
if (node.data.href) {
window.open(node.data.href, "_self");
}
},
persist: true,
noLink: false,
fx: { height: "toggle", duration: 200 }
});
});
我需要激活的節點,如果有一個樹被加載到DOM之後。該文件建議使用這種方法:
// Loads tree
$("#TreeManGrp").dynatree({
initAjax: {
url: "/Terminals/Refresh/",
success: function (data) {
alert("hi");
}
},
onActivate: function (node) {
if (node.data.href) {
window.open(node.data.href, "_self");
}
},
persist: true,
noLink: false,
fx: { height: "toggle", duration: 200 }
});
但這也不工作。通過dynatree源Looing文件,它說:
if (ajaxOpts.success) {
this.logWarning("initAjax: success callback is ignored; use onPostInit instead.");
}
我的問題是沒有人知道如何使用代替onPostInit?