开发者

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}
                }
        },
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜