easyUI comboselector使用

easyUI提供了一个数据选择框 comboselector

<input name="brand_name" id="brand_name" value="" class="easyui-validatebox" data-options="required:false, validType:'',  prompt: ''">

 

    $("#brand_name").comboselector($.extend({},window.brandList)); //会在input标签后面加上选择框按钮

window.brandList={
        topMost:false,
        extToolbar:true,
        toolbar:[
            "品牌名",    
            {id:'searchtext',type:'textbox',options:{'width':80}},
            {type:"button",options:{
                text:"查询",iconCls:"icon-search",handler:function(toolbar){
                    alert(toolbar);
                    var bar=$(toolbar),searchtext=bar.find("#searchtext").val(),
                    dg=bar.closest(".grid-selector-container").find(".grid-selector");
                    $.easyui.messager.show("查询 品牌名:{0}".format(searchtext));
                    dg.datagrid("load", { name : searchtext});
                }
              }
            }        
        ],
        singleSelect:true,
        //multiple:false,  
        method:"get",
        url:'${ctx}/car/brand/json', 
        idField:'id',
        textField:'name',
        autoShowPanel:false,
        remoteSort:false,
        pagination:true,
        columns:[[
        {field:"ck",checkbox:true},
        {field:"id",title:'ID',width:80},
        {field:"name",title:'品牌名',width:80}
       
        ]],
        onEnter: function (val) { $.easyui.messager.show(String(val.map(function (val) { return val.ID; }))); },
        onChange: function (newValue,oldValue) {}
}

转载于:https://www.cnblogs.com/temporary/p/7240324.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值