我已經創建了一個jstree,並且通過jstree的id獲取節點時遇到問題。 當我使用get_node,我得到一個錯誤:如何通過Jstree中的ID獲取節點
TypeError: $(...).jstree.get_node is not a function
這是HTML代碼:
<div style="height: 75%; margin: 0; width: 100%;">
<div id="dashboardTree" style="border: 0; height: 99%; margin: 0; margin-top: 2px; overflow: auto; width: 99%;">
</div>
</div>
這是JavaScript:
$(document).ready(function() {
initDashboardArchiveTree();//Initial tree
var node = $('#dashboardTree').jstree(true).get_node('1')//get that error
});
如何通過ID在jsTree得到節點?這段代碼有什麼問題?
請將您的initDashboardArchiveTree代碼儘可能填滿 – clevertension