jquery plugin treegrid 怎么异步加载
发布网友
发布时间:2022-12-10 19:15
我来回答
共1个回答
热心网友
时间:2023-10-07 15:02
function appendTree(row){
$.getJSON(basePath+'/backend/getOrgs.do?time='+decodeURI(''+new Date()), {
enableFlag: 'Y',
parentOrgId: row.orgId
}, function(json){
if(json.rows[0]){
var childrenNodes = $('#select').treegrid('getChildren',row.id);
for(var i=0; i<childrenNodes.length; i++){
var childrenNode = childrenNodes[i];
if($('#select').treegrid('find',childrenNode.id) != null){
$('#select').treegrid('remove',childrenNode.id);//移除
}
}
$('#select').treegrid('append',{
parent: row.orgId,
data: json.rows
});
}
});