var goodstypeStore = new Ext.data.Store({
autoLoad : true,
fields : [ "id", "goodsTypeName" ],
proxy : {
type : 'ajax',
url : 'searchGoodstypeName',
reader : {
type : 'json',
root : 'result'
}
}
});
/**
* 向下拉列表中插入全部选项.
*/
goodstypeStore.on('load', function (store) {
store.insert(0,{
goodsTypeName: '全部',
id: ''
});
});
/**
*下拉列表框.
*/
xtype : "combo",
id : "shop-goodsTypeId",
name : "goodsinfo.goodsTypeId",
fieldLabel : '商品类别',
store : goodstypeStore,
triggerAction: 'all',
hasNullValue:true,
emptyText: '请选择...',
editable : false,
queryMode : 'local',
displayField : 'goodsTypeName',
valueField : 'id',
flex:1
[前端]-Extjs 向下拉列表引用的Store内 插入一条全部的选项。
最新推荐文章于 2019-04-19 15:03:37 发布
本文介绍如何使用 ExtJS 实现商品类别选择的下拉框功能,包括动态加载商品类型数据、设置下拉框属性及在列表中插入默认选项。
5257

被折叠的 条评论
为什么被折叠?



