首页 > 其他分享 >EasyUI的combotree 默认节点选中呢

EasyUI的combotree 默认节点选中呢

时间:2023-03-09 15:32:01浏览次数:47  
标签:node selShenqFuwujg EasyUI combotree tree id data 节点


$('#selShenqFuwujg').combotree({
url: '../../GetFuwujgInfo.aspx?type=GetFuwujgTree&PID=',
onl oadSuccess: function (node, data) {
if (!loadFlag && data != null) {
node = $('#selShenqFuwujg').combotree("tree").tree("find", data[0].id);
loadFlag = true;

//for (i = 0; i < node.length ; i++) {
// node = $('#selShenqFuwujg').combotree('tree').tree('find', node[i]);
// $('#selShenqFuwujg').combotree('tree').tree('check', node.target);
// $('#selShenqFuwujg').combotree('tree').tree('expandAll', node.target);
//}
//debugger;
//$('#selShenqFuwujg').combotree("setValue", data[0].id);
$('#selShenqFuwujg').combotree('setValue', { id: data[0].id, text: data[0].text });
//$('#selShenqFuwujg').combotree("check", data[0].id);

}
},
onBeforeExpand: function (node) {
var children = $('#selShenqFuwujg').combotree("tree").tree('getChildren', node.target);
if (children.length < 1) {
trnode = node.id;
$('#selShenqFuwujg').combotree("tree").tree("options").url = '../../GetFuwujgInfo.aspx?type=GetFuwujgTree&PID=' + node.id;
}
},
onChange: function (newValue, oldValue) {
}
});

重点 实现就一句

$('#selShenqFuwujg').combotree('setValue', { id: data[0].id, text: data[0].text });

EasyUI的combotree 默认节点选中呢_i++

注意easyui的版本

其他实现方式请参考文末的[参考文献]


ui15HxuSTE8K4I5UoduCikUW9sF0L+AeUqXS2ZYcGgbtX6y9N2sgIXj7t2tdVuUkUXjQIw07pmpW8kf4dsAaF57DErBAAVTfrD744z8U0a50m6Ylijf/sjVyDuDzCvulXz+2yByNbN/Wx6IfeNeDYttsqR97o62E32bWzqxjjgs=



[2]http://aokunsang.iteye.com/blog/1489204


标签:node,selShenqFuwujg,EasyUI,combotree,tree,id,data,节点
From: https://blog.51cto.com/u_15999672/6110602

相关文章