jquery plugin treegrid 怎么异步加载
1个回答
展开全部
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
});
}
});
$.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
});
}
});
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询