码迷,mamicode.com
首页 > Web开发 > 详细

extjs combo中给Store插入一条数据

时间:2017-08-19 13:01:41      阅读:202      评论:0      收藏:0      [点我收藏+]

标签:length   and   insert   store   pts   llb   level   back   config   

 

技术分享

{
xtype: ‘combo‘,
columnWidth: .55,
name: ‘AQLLevel‘,
store: Ext.create(‘Scripts.Code.Common.store.InspLevelSwitchingStore‘),
editable: false,
queryMode: ‘local‘,
matchFieldWidth: false,
listConfig: { width: 200 },
valueField: ‘COMM_CODE‘,
displayField: ‘COMM_CODE_NM‘,
listeners:
{
render: function (com) {
var store = com.getStore();
store.load({
callback: function () {
var data = [{ COMM_CODE: ‘‘, COMM_CODE_NM: ‘ALL‘ }];
if (store.data.items.length > 0) {
if (store.getAt(0).data.COMM_CODE_NM != ‘ALL‘) {
store.insert(0, data);
}
} else {
store.insert(0, data);
};
com.select(store.data.items[0]);
}
});
},
expand: function (field, eOpts) {
var store = field.getStore();
var data = [{ COMM_CODE: ‘‘, COMM_CODE_NM: ‘ALL‘ }];
if (store.data.items.length > 0) {
if (store.getAt(0).data.COMM_CODE_NM != ‘ALL‘) {
store.insert(0, data);
}
} else {
store.insert(0, data);
};
}
}//end listeners
}

 

extjs combo中给Store插入一条数据

标签:length   and   insert   store   pts   llb   level   back   config   

原文地址:http://www.cnblogs.com/hqyj/p/7395790.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!