EasyUI的combotree 默认节点选中呢

$('#selShenqFuwujg').combotree({
            url: '../../GetFuwujgInfo.aspx?type=GetFuwujgTree&PID=',
            onLoadSuccess: 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的版本

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


ui15HxuSTE8K4I5UoduCikUW9sF0L+AeUqXS2ZYcGgbtX6y9N2sgIXj7t2tdVuUkUXjQIw07pmpW8kf4dsAaF57DErBAAVTfrD744z8U0a50m6Ylijf/sjVyDuDzCvulXz+2yByNbN/Wx6IfeNeDYttsqR97o62E32bWzqxjjgs=

参考文献:

[1]http://bbs.csdn.net/topics/370205131

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

[3]http://blog.csdn.net/zhu_nana/article/details/50036275

[4]http://www.cnblogs.com/jingsha/p/5596745.html

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值