也许我在配置上犯了一个错误,但是这个插件的大多数功能对我不起作用。有人知道我该如何解决吗?非常感谢您的帮助。
展示:https://codepen.io/keshrath/pen/XGgLgg?editors=1011
let children = []
for (var i = 0; i<50; i++){
children.push({
'text': 'Child '+i,
'data': {
'price': '$'+i
}
});
}
$('#jstree_demo').jstree({
"core" : {
"animation" : 0,
"check_callback" : true,
"themes" : { "stripes" : true },
'data': [{
'text': 'Root node',
'state': {
'opened': true
},
'children': children
}]
},
"types" : {
"#" : {
"max_children" : 1,
"max_depth" : 4,
"valid_children" : ["root"]
},
"root" : {
"icon" : "/static/3.3.7/assets/images/tree_icon.png",
"valid_children" : ["default"]
},
"default" : {
"valid_children" : ["default","file"]
},
"file" : {
"icon" : "glyphicon glyphicon-file",
"valid_children" : []
}
},
'grid': {
'columns': [{
'header': 'Nodes',
'width': 180
}, {
'header': 'Price',
'width': 180,
'value': function(node) {
return (node.data && node.data.price);
}
}],
fixedHeader: true,
resizable: true,
contextmenu: true,
},
"plugins" : [
"contextmenu", "dnd", "search",
"state", "types", "wholerow", "grid"
]
});