我有在同一jstree裝載2個小提琴,一種被包裝在一個角指令,另一種是不。我對角度很陌生。我沒有看到角度版本中的任何圖像。此外,動畫不起作用。我是否缺少一個jstree插件,還是我需要添加一個綁定函數來添加此功能?包裝JSTree在角指令
這裏是小提琴:(不在角JS)
這裏是簡單js樹代碼:
$('#tree').jstree({
'plugins' : ['themes', 'json_data', 'checkbox', 'types'],
'icon':false,
'checkbox' : {
'two_state' : true // Nessesary to disable default checking childrens
},
"json_data" : {
"data" : [
{
"data" : "Basics",
"state" : "open",
"children" : [{
"data" : "login",
"state" : "closed",
"children" : [ "login", {"data" : "results", "state" : "open"} ]
},
{
"data" : "Basics",
"state" : "closed",
"children" : [ "login", "something",{"data" : "results", "state" : "closed"} ]
}
]
},
{
"data" : "All",
"state" : "closed",
"children" : [ {
"data" : "AddCustomer",
"state" : "closed",
"children" : [ "login","Add", {"data" : "results", "state" : "closed"} ]
} ]
}
]
},
"types" : {
"types": {
"disabled" : { // Defining new type 'disabled'
"check_node" : false,
"uncheck_node" : false
},
"default" : { // Override default functionality
"check_node" : function (node) {
$(node).children('ul').children('li').children('a').children('.jstree-checkbox').click();
return true;
},
"uncheck_node" : function (node) {
$(node).children('ul').children('li').children('a').children('.jstree-checkbox').click();
return true;
}
}
}
}
});
這裏是角指令一個plunker:
是啊,我剛剛創建的實例後,意識到這一點。謝謝你的幫助! – user648869