Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to use Json Data in version 4/9/2012 (New test) #195

Closed
EricLendvai opened this issue Apr 9, 2012 · 2 comments
Closed

Fails to use Json Data in version 4/9/2012 (New test) #195

EricLendvai opened this issue Apr 9, 2012 · 2 comments

Comments

@EricLendvai
Copy link

Using the sample JSON demo1 code, the new version does not render the tree. It used to work with the version dated 7/12/2011.

$("#demo1").jstree({
"json_data" : {
"data" : [
{
"data" : "A node",
"metadata" : { id : 23 },
"children" : [ "Child 1", "A Child 2" ]
},
{
"attr" : { "id" : "li.node.id1" },
"data" : {
"title" : "Long format demo",
"attr" : { "href" : "#" }
}
}
]
},
"plugins" : [ "themes", "json_data", "ui" ]
}).bind("select_node.jstree", function (e, data) { alert(data.rslt.obj.data("id")); });

@denever
Copy link

denever commented Apr 15, 2012

I had the same problem.

I just take a look to jstree.json.js. It seems to me that now json_data plugin is only called "json".

@denever
Copy link

denever commented Apr 15, 2012

I found also that, In jstree.json.js line 42,

dom.children('ul').empty().append(data.children('li'));

data.children('li'); is always empty.

dom.children('ul').empty().append(data); <--- this works for me.

@vakata vakata closed this as completed in c2795fe Aug 23, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants