【发布时间】:2016-01-12 15:25:53
【问题描述】:
我正在使用延迟加载的 jstre 3.2.1,一切正常。 这是我在 asp.net mvc5 操作中填写的 Json 类。
public class AutorisationNodeModel
{
public int id { get; set; }
public string text { get; set; }
public List<AutorisationNodeModel> children { get; set; }
public State state { get; set; }
}
public class State
{
public bool selected { get; set; }
}
和视图
$("#AutorizationTree").jstree({
"core": {
"themes": {
"responsive": false
},
// so that create works
"check_callback": true,
'data': {
"type": "POST",
"dataType": "json",
'url': function (node) {
return '@Url.Action("GetTreeNodes", "Administration")';
},
'data': function (node) {
return { 'IdApplication': $('#AppSelectionne').val() };
}
}
},
"types": {
"default": {
"icon": "fa fa-folder icon-state-success icon-lg"
},
"file": {
"icon": "fa fa-file icon-state-success icon-lg"
}
},
"plugins": ["dnd", "types", "checkbox", "json_data"],
"checkbox": { "tie_selection": false }
});
但预先选择的节点无法正常工作,请帮我解决这个问题
【问题讨论】:
-
你为什么要设置
"tie_selection": false? -
我找到了一个将“tie_selection”设置为 false 的示例
标签: asp.net-mvc jstree