在kendo ui treeview中是否存在黑客攻擊,因此當用戶單擊根節點時,它將觸發select方法,就像其他分支節點一樣。Kendo UI TreeView可選擇的根目錄
當前沒有可以爲此行爲找到的選項,並且僅爲分支觸發了select方法。
var areaDropDownTreeView = $(tvElement).kendoExtDropDownTreeView({
treeview: {
template: kendo.template($(tvTemplate).html()),
dataSource: dataSource
}
}).data("kendoExtDropDownTreeView");
var $dropdownRootElem = $(areaDropDownTreeView.dropDownList().element).closest("span.k-dropdown");
var $treeviewRootElem = $(areaDropDownTreeView.treeview().element).closest("div.k-treeview");
// Unbind default select event.
areaDropDownTreeView.treeview().unbind("select");
// Bind new select event.
areaDropDownTreeView.treeview().bind("select", function (e) {
// want to do something here for every node including the root, but the root is not triggering select, only the branches are
});
謝謝了問題 – Zan