jstree types plugin
This is my current JSON input for my jstree (using jstree-grid for the data):
{
data: "StrukturNavn",
attr: {id:"1", class:"structureNode", contentItemId:"123", rel:"root"},
children: [
{
data: "Seksjon 1",
attr: {id:"2", class:"structureNode",开发者_开发百科 contentItemId:"231"}
}
]
}
And this is the relevant jstree code:
types: {
root : {delete_node: false}
},
plugins: ["json_data", "crrm", "ui", "themes", "grid", "types"],
But, for some reason, the root node is still deletable, what am I doing wrong?
Thanks :-)
I found the problem, I was simply not configuring the plugin correctly.
types: {
root : {delete_node: false}
},
should be
types: {
valid_children: ["root"],
types: {
root : {delete_node: false}
}
},
精彩评论