【发布时间】:2017-01-09 16:03:38
【问题描述】:
JsTree-grid 插件无法按预期工作。我通过 JSON 文件响应的 AJAX 请求获取节点数据(包括网格列的数据)。
JS sn-p:
.jstree({
'core' : {
'data' : {
'url' : '/cms/ajax/ajax_json_tree.php?table=subpages_tree&operation=get_node',
'data' : function (node) {
return {
'id' : node.id,
'seo_title' : node.seo_title
};
},
'dataType' : 'json'
},
'check_callback' : true,
'themes' : {
'responsive' : false
}
},
'plugins' : ['state','dnd','contextmenu','grid'],
grid: {
columns: [
{width: 300, header: "Name"},
{width: 100, header: "SEO", value: "seo_title"}
]
},
'force_text' : true
})
JSON 响应来自:
/cms/ajax/ajax_json_tree.php?table=subpages_tree&operation=get_node
[
{
"id":255,
"text":"NEWS",
"children":true,
"seo_title":"news"
},
{
"id":256,
"text":"DEVWEBMAIL",
"children":false,
"seo_title":"devwebmail"
}
]
不知何故node.seo_title总是未定义。你能解释这是为什么吗?似乎问题在于 jstree 中的网格插件集成。
版本:我使用的是 jstree 3.3.3.0 和 jstreegrid 3.4.2。
【问题讨论】:
标签: javascript jstree