extjs combo设置默认值为什么没有效果?应该怎么设呢?代码如下:
items:[{xtype:'combo',alias:'widget.planSearchYear',width:110,triggerAction:'all',sto...
items: [{
xtype: 'combo',
alias: 'widget.planSearchYear',
width: 110,
triggerAction: 'all',
store: yearStore,
mode: 'local',
displayField: 'text',
valueField: 'name',
editable: false,
forceSelection: true,
emptyText: '请选择年',
fieldLabel: iPlanSearch.iPlanSearchYearAndMonth,
labelWidth: 30,
name: 'planSearchYear',
listeners: {
afterRender: function (combo) {
var defaultValue = thisYear;
combo.setValue(defaultValue);
}
},
defaultListConfig: {
loadMask: false
}
}
] 展开
xtype: 'combo',
alias: 'widget.planSearchYear',
width: 110,
triggerAction: 'all',
store: yearStore,
mode: 'local',
displayField: 'text',
valueField: 'name',
editable: false,
forceSelection: true,
emptyText: '请选择年',
fieldLabel: iPlanSearch.iPlanSearchYearAndMonth,
labelWidth: 30,
name: 'planSearchYear',
listeners: {
afterRender: function (combo) {
var defaultValue = thisYear;
combo.setValue(defaultValue);
}
},
defaultListConfig: {
loadMask: false
}
}
] 展开
2个回答
2014-03-07
展开全部
空值用emptyText 默认值用value:‘’
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询