Ich habe eine Variable und ich möchte es an übergeben.Weitergabe von JSON als Variable an jsTree
Versuchte:
$('#tree').jstree({
plugins: ["checkbox", "types"],
"types": {
"file": {
"icon": "jstree-file"
}
},
'core': {
'data': mdata.data
}
});
//------------------------------
$('#tree').jstree({
plugins: ["checkbox", "types"],
"types": {
"file": {
"icon": "jstree-file"
}
},
'core': {
'data': JSON.stringify(mdata.data)
}
});
//------------------------------
$('#tree').jstree(mdata.data)
Meine JSON Variable (mdata.data
) wird bereits von JSON.parse()
analysiert. Ich habe es über jsonlint.com validiert und validiert. Hier ist sie:
[{
"soslist": [{
"code_intext": "utf-8",
"count_of_pages": 2,
"count_of_records": 7,
"curobj": "1",
"obj": "1",
"page": 1
}, {
"code_intext": "utf-8",
"count_of_pages": 2,
"count_of_records": 7,
"curobj": "1",
"obj": "1",
"page": 1
}],
"system": [{
"count_of_pages": 2,
"count_of_records": 7,
"curobj": "1",
"page": 1
}]
}]
mdata.data
in der Konsole:
Ist es überhaupt möglich oder jsTree benötigen spezifische JSON Struktur und Material wie id
und parent_id
?