Jstree控件的使用困局,跪求各位指点 javascriptjstree 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 官方给出的demo格式如下:$('#using_json_2').jstree({ 'core' : { 'data' : [ { "id" : "ajson1", "parent" : "#", "text" : "Simple root node" }, { "id" : "ajson2", "parent" : "#", "text" : "Root node 2" }, { "id" : "ajson3", "parent" : "ajson2", "text" : "Child 1" }, { "id" : "ajson4", "parent" : "ajson2", "text" : "Child 2" }, ]} });我们在后台返回了[ .. ]里一样格式的内容,但是提示jstree不识别,不知道是我们哪里理解得有偏差 这个是官方给出的调用方式:// AJAX$('#tree').jstree({ 'core' : { 'data' : { 'url' : '/get/children/', 'data' : function (node) { return { 'id' : node.id }; } } });调用方式和返回数据的格式都严格按照官方的说明来做,但结果就是不成功,相关支持文档很少,找不到原因~~ 'data' : function (node) { return { 'id' : node.id }; }能行??json还能传function?用惯了jquery的$.ajax么 知道封装吗?没有说这个是直接传给$.ajax,是经过判断口调用的。参考: jstree / src / jstree.js中第1092行开始的部分。 求一个javaScript写的日期选择控件. web上组卷策略算法? 一个简单的js问题 怎样用JS获取所有的页面中asp:label 双向选择器取不到值 发现一个奇怪现象--关于document.getElementById的问题 nowrap如何使用? 请教:JS文件的格式是怎么的? 如何控制用户输入的字符为数字? npm 包已经安装成功,运行的时候就报错,没安装模块 一个浏览器插件,但是需要输入注册码,JS的,有人懂吗? 如何引用高等数学计算JS库
'data' : [
{ "id" : "ajson1", "parent" : "#", "text" : "Simple root node" },
{ "id" : "ajson2", "parent" : "#", "text" : "Root node 2" },
{ "id" : "ajson3", "parent" : "ajson2", "text" : "Child 1" },
{ "id" : "ajson4", "parent" : "ajson2", "text" : "Child 2" },
]
} });我们在后台返回了[ .. ]里一样格式的内容,但是提示jstree不识别,不知道是我们哪里理解得有偏差
$('#tree').jstree({
'core' : {
'data' : {
'url' : '/get/children/',
'data' : function (node) {
return { 'id' : node.id };
}
}
});调用方式和返回数据的格式都严格按照官方的说明来做,但结果就是不成功,相关支持文档很少,找不到原因~~
{
return { 'id' : node.id };
}
能行??json还能传function?用惯了jquery的$.ajax么
参考: jstree / src / jstree.js中第1092行开始的部分。