easyUI的tree默认使用post请求,但是官方文档没有提及如何携带参数,我试过loader,但是没有搞懂怎么用,到网上查了一下,找到了传递参数的方法。通过queryParams来携带参数。
<ul id="tt"></ul>
$("#tt").tree({
url: '/getTree',
method: 'post',
queryParams: {
id: 2
},
formatter: function (node) {
return node.text;
},
loadFilter: function (data) {
if (data.d) {
return data.d;
} else {
return data;
}
},
onClick: function (node) {
console.log("onClick");
console.log(node);
},
onLoadSuccess: function (node, data) {