//该功能所需代码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
//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
//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
//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
}
}]
});