jstree : Uncaught TypeError: Cannot read property 'children' of undefined

我是研究僧i 提交于 2019-12-05 10:14:04

I'm working with Ajax .

the problem I resolved it by declaring a new object javaScript that contains( id, parent, text)

exemple :

 var objJS = new Object(); 
 objJS .id = ObjectJason.id;
 objJS .parent = ObjectJason.parent!=="0" ?  ObjectJason.parent:"#";
 objJS .text = ObjectJason.text;

I declare an Array where I push all my objects and give it to 'data', like this

 $('#jstree_demo_div').jstree({
                'core': {
                    'data': Array ;
                }
            });

and it's working perfectly! I wish it will help a lot of people

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!