嗨,我正在尝试在渲染树后更新节点的数据属性。我正在使用下面的代码来做同样的事情。
let nodes = $('#direct_role_tree').jstree().get_json('#',{flat:true});
nodes[0].data.myAttribute = 1;
// Now if i try to read the value of myAttribute like below , it is coming undefined
nodes = $('#direct_role_tree').jstree().get_json('#',{flat:true});
console.log(nodes[0].data.myAttribute) //This prints undefined instead of 1
请帮忙。
注意:我已经尝试过这里提到的解决方案, 但没有成功