jstree通过前台js生成了树,但是没有链接,js代码如下 $(function() {
$("#demo0").bind('loaded.jstree', function(e, data) {
// invoked after jstree has loaded
$('#demo1>ul>li').addClass('topMenu');
}).jstree({
"themes": { "theme": "classic" },
"json_data": {
"ajax": { "type": "POST",
"dataType": "json",
"contentType": "application/json;",
"url": "/Desktop/MenusFunc.aspx/GetAllNode",
"data": function(node) {
if (node == -1) {
return '{ "operation" : "get_children", "parentId" : ' + 1 + '}';
} else {
return '{ "operation" : "get_children", "parentId" : ' + $(node).attr("id") + '}';
}
},
"success": function(retval) { return retval.d; }
}
},
"plugins": ["themes", "json_data"]
});
});后台生成的json格式如下,存在href的属性但是在最终生成的节点代码没有链接的属性,<a href="#"><ins class="jstree-icon"> </ins>Claim Summary</a>想请教下这是为什么?
$("#demo0").bind('loaded.jstree', function(e, data) {
// invoked after jstree has loaded
$('#demo1>ul>li').addClass('topMenu');
}).jstree({
"themes": { "theme": "classic" },
"json_data": {
"ajax": { "type": "POST",
"dataType": "json",
"contentType": "application/json;",
"url": "/Desktop/MenusFunc.aspx/GetAllNode",
"data": function(node) {
if (node == -1) {
return '{ "operation" : "get_children", "parentId" : ' + 1 + '}';
} else {
return '{ "operation" : "get_children", "parentId" : ' + $(node).attr("id") + '}';
}
},
"success": function(retval) { return retval.d; }
}
},
"plugins": ["themes", "json_data"]
});
});后台生成的json格式如下,存在href的属性但是在最终生成的节点代码没有链接的属性,<a href="#"><ins class="jstree-icon"> </ins>Claim Summary</a>想请教下这是为什么?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货