需求:实现一个用radio来确定是否显示某一控件
关键代码:
{
xtype: 'radiogroup',
fieldLabel: '计划类型',
cls: 'x-check-group-alt',
items: [
{boxLabel: '产品', name: 'rbauto', inputValue: 1},
{boxLabel: '非产品', name: 'rbauto', inputValue: 2, checked: true}
],
listeners:{
change: function( tb , newValue , oldValue , eOpts ) {
if (newValue.rbauto == 1) {
Ext.getCmp('comboProduct').setDisabled(false);
} else {
Ext.getCmp('comboProduct').setDisabled(true);
};
}
}
},
{
xtype:"combo",
name:'comboProductId',
id:'comboProduct',
disabled: true,
fieldLabel:'产品名称',
displayField:'productName',
valueField:'id',
triggerAction: 'all',
store: {
type : 'comboBoxProductStore',
},
triggerAction:'all',
queryMode: 'remote',
queryParam:'hostId',
allQuery: Ext.getCmp('assetId_monitorPlanList').getValue(),
selecOnFocus:true,
forceSelection:true,
allowBlank:false,
editable:false,
listConfig: {
loadingText: '正在加载', //加载数据时显示的信息
emptyText: '该主机没有绑定产品', //当值不在列表时的提示信息
maxHeight: 360
},
afterLabelTextTpl: [
'<span style="color:red;font-weight:bold" data-qtip="必填选项">*</span>'
],
emptyText:'请选择产品',
blankText:'请选择产品',
listeners:{
}
}