jstree 属性初始化后如何修改

问题描述

嗨,我正在尝试在渲染树后更新节点的数据属性。我正在使用下面的代码来做同样的事情。

    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

请帮忙。

注意:我已经尝试过 here 提到的解决方案,但没有成功

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)