Yes, it looks a little bit awkward at first glance, but when you are
making some complex menu it leads to easier to mantain and shorter
code. E.g. you don't have to put the same conditions in every item,
but make one condition and set all appriopriate items in it, another
condition - another items, etc.
And in simple cases, you could do something, like:
contextmenu: {
items: function (NODE, TREE_OBJ) {
return {
create: {
label: 'Create',
action: function() {/*...*/},
disabled: 'type1' == NODE.attr('rel')
//...
},
rename: {
label: 'Rename',
action: function() {/*...*/},
disabled: 'type12' == NODE.attr('rel')
//...
},
some_other_action: {
label: 'Some other action',
action: function() {/*...*/},
disabled: 'type3' == NODE.attr('rel')
//...
},
// etc.
}
}
And it will look almost like in 0.9.9. :)
Best regards,
ChrisRaven