easyui的combobox、combotree

本文介绍了使用EasyUI框架配置combobox单选和combotree多选组件的方法。包括前端HTML代码示例及对应的JavaScript初始化代码,展示了如何加载数据并设置默认选项。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1.combotree多选

   <1>class:easyui-combotree  , multiple多选

   <input type="text" style="width:100px;" id="section" name="section" class="easyui-combotree" multiple data-options="" />

   <2>方法

       function GetSection() {
        $.post('@Url.Action("GetSection")', function (data) {
            $("#section").combotree('loadData', [{
                id: '全部',
                text: '全部',
                checked: true,
                children: data
            }]);
            $(".tree-icon").removeClass("tree-file");
            $(".tree-indent").removeClass("tree-indent");
            $(".tree-hit").removeClass("tree-expanded");
            $(".tree-icon").removeClass("tree-folder-open");
            $(".tree-icon").removeClass("tree-folder");
            // getData();
        }, "json");
    }



2.combobox单选

  <1>class:easyui-combobox,后台方法url:'@Url.Action("GetSection")',默认选中的值value:'110000HRSK01'

    <input type="text" style="width:100px;" id="section" name="section" class="easyui-combobox" data-options="url:'@Url.Action("GetSection")',value:'110000HRSK01'" />


   

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值