The tree is not rendered, nothing happens.
DrYurets opened this issue · 0 comments
DrYurets commented
Hello. Please tell me why I can’t connect the plugin in Yii2.
- Plugin version 1.8.2
- jQuery v3.6.4
There are no errors in the console, but the tree is not rendered, just an empty div element. I included the CSS styles file, and also included the jquery.mockjax.js
plugin just in case
<div id="tree1" class="tree"></div>
let treeData = [
{
name: "node1",
children: [
{ name: "child1" },
{ name: "child2" }
]
},
{
name: "node2",
children: [
{ name: "child3" }
]
}
],
treeElement = $("#tree1");
if ( $.isFunction($.fn.tree) ) console.log("tree is a function");
if (treeElement.length) console.log("tree element found");
treeElement.tree({
data: treeData,
autoOpen: true,
dragAndDrop: true
});
treeElement.on(
"tree.loading_data",
function(e) {
console.log(e.isLoading, e.node);
}
);
What could be wrong?