EXTJS combo 控件:
1.先定义store
//年款
var comboData_ReleasYear = [
['', ''],
['', ''],
['', ''],
['', '']
];
2.定义combo控件
{
layout: 'form',
labelWidth: ,
width: ,
items: [{
xtype: 'combo', name: 'ReleasYear', allowBlank: false,
fieldLabel: '年款', width: ,
store: new Ext.data.SimpleStore({
fields: ['Id', 'Name'],
data: comboData_ReleasYear
}),
valueField: "Id",
displayField: "Name",
mode: 'local',
editable: false,
triggerAction: 'all',
allowBlank: false,
autoload: true,
listeners: {
'select': function (combo, record, index) {
var ReleasYear = PKUPanelForm.form.findField('ReleasYear').getRawValue();
if (ItemStorePKU.getCount() == ) {
ItemStorePKU.insert(, new ItemStorePKU.recordType({ ReleasYear: ReleasYear }));//插入到最后一行
} else {
for (var i = ; i < ItemStorePKU.getCount() ; i++) {
ItemStorePKU.insert(i, new ItemStorePKU.recordType({ ReleasYear: ReleasYear }));//插入到最后一行
}
}
}
}
}
]
}