applyAccount.gridManager = new Ext.grid.GridPanel({
//title : '客戶經理選取列表',
store : applyAccount.storeManager,
colModel : applyAccount.colModelManager,
bbar : applyAccount.CusBbar,
selModel : applyAccount.CusSelModel,
columnLines : true,//否顯示列分割線,默認為false
autoScroll : 'auto',
autoSizeColumns : true,//根據列內容自動適應列寬度
viewConfig : {
forceFit : true
},
loadMask : true,
tbar : [
'客戶經理編號:',{
id : 'ManagerNumP',
xtype : 'textfield'},'-',
{
text : '查詢',
iconCls : 'query',
handler : function() {
applyAccount.storeManager.load({
params: { start: 0,
limit: applyAccount.CusPageSize,
level:2,
managerNum:Ext.get('ManagerNumP').dom.value
},
callback:function(store,resc){
var record2 = applyAccount.grid.getSelectionModel().getSelected();
if(record2){
var records = new Array();
applyAccount.storeManager.each(function(record){
if(record.data.account == record2.data.clientManagerNum){
records.push(record);
}
});
applyAccount.CusSelModel.selectRecords(records,true);
}
}
});
}
}]
});
這裡面的id怎麼設置成動態的呢?不是寫死的這種
var domID = 'ManagerNumP';//////////////修改這個變量
applyAccount.gridManager = new Ext.grid.GridPanel({
//title : '客戶經理選取列表',
store: applyAccount.storeManager,
colModel: applyAccount.colModelManager,
bbar: applyAccount.CusBbar,
selModel: applyAccount.CusSelModel,
columnLines: true,//否顯示列分割線,默認為false
autoScroll: 'auto',
autoSizeColumns: true,//根據列內容自動適應列寬度
viewConfig: {
forceFit: true
},
loadMask: true,
tbar: [
'客戶經理編號:', {
id: domID,//////////////
xtype: 'textfield'
}, '-',
{
text: '查詢',
iconCls: 'query',
handler: function () {
applyAccount.storeManager.load({
params: {
start: 0,
limit: applyAccount.CusPageSize,
level: 2,
managerNum: Ext.get(domID).dom.value////////////////