Extjs 复选框下拉列表


//该功能所需代码start
//判断是否选中
function onclicks(value){
//debugger
    //判断获取到的焦点是否·点击的是checkbox
    if(document.activeElement.type == 'checkbox'){
        if(document.activeElement.checked == true){
            document.activeElement.checked = false;
        }else {
            document.activeElement.checked = true;
        }
    }
    var res = value.firstChild.firstChild.checked;
    if(res == true){
        value.firstChild.firstChild.checked = false;
    }else {
        value.firstChild.firstChild.checked = true;
    }
};
//end
Ext.define('CarInlineApp.view.CarInlineSearchView' ,{
    extend: 'Ext.form.Panel',
    alias : 'widget.carInlineSearchView',
    itemId :'carInlineSearchView',
    title: '车辆上线率报表搜索',
    frame : true,
    
    region: "north",
    height:130,
    collapsible: true,
    collapseMode: "mini",
    split: true,
    bodyStyle : 'padding:4px 2px 3px 4px',
    layout : {
        type : 'table',
        align : 'right',
        columns : 4
    },
    fieldDefaults: {
        labelAlign: 'right',
        labelWidth: 60
    },
    items : [
//start
//带复选框下拉列表
{
      xtype : 'combo',
      width : 400,
      labelWidth: 100,
      id : 'c_customername',
      labelAlign: 'right'    ,
      store :"CustomerListStore",
      valueField : 'customerid',
      displayField : 'customername',
      fieldLabel : '客户名称(可多选)',
      multiSelect:true,
      emptyText:'请选择',
      queryMode: 'local',
      editable:false,
      listConfig: {
            itemTpl:  '<tpl for="."><div name="x-combo-list-item" onClick="onclicks(this)"><span><input type="checkbox" name="x-checkbox-list"  id = "{[values.customerid]}" value="{[values.customerid]}" />  {customername}</span></div></tpl>'
       },
       triggerAction: 'all'
}
//end
],
    buttons : [{
                text : '查询',
                id : 'mailset_query',
                tooltip : '查询',
                iconCls : 'common-search-icon',
                action: 'search'
            }, {
                text : '重置',
                id : 'mailset_reset',
                tooltip : '清空查询条件',
                iconCls : 'common-reset-icon',
                action : 'reset',
                handler: function(button){
                      button.up('form').getForm().reset();
//start
                                            //获取复选框
                      var   getCK=document.getElementsByName('x-checkbox-list');  
                      var   j=0;  
                       
                      for(var   i=0;i<getCK.length;i++)  
                      {  
                          whichObj=getCK[i];  
                          if(whichObj.type=="checkbox")  
                          {  
                              whichObj.checked=false;  
                              j++;  
                          }  
                      }   //end
                }

            }]
}); 
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值