0
私はExtJS 3.3.0を使用しており、コンボボックスに値があるまで保存ボタンを無効にしたい。ExtJS 3.3.0コンボボックスに値があるまで保存ボタンを無効にする
私はそのようにコンボボックスを作成しています。
new Ext.form.ComboBox({
id: this.idName + 'Combo_StateID',
name: 'StateID',
fieldLabel: 'State',
singleOnly: true,
typeAhead: true,
triggerAction: 'all',
store: StateStore,
mode: 'remote',
valueField: 'StateID',
hiddenField: 'StateID',
displayField: 'StateNumber',
lazyInit: false,
listClass: 'x-combo-list-small',
tpl: '<tpl for=\".\"><div class=\"x-combo-list-item\"><span style=\"width: 50px;\">#{StateNumber}</span></div></tpl>',
}), ") . "
私は単純にボタンを作成しています。
newPanel.addButton(
{
iconCls:'icon-ok',
text: 'Save Data'
}
)
これはすべて問題なく動作します。ボタンを無効にすると、私は全く理解できません。
私は以下を試しましたが、それでも何もありません。
listeners: {
afterrender: function() {
if (this.getValue() === null) {
Ext.getCmp('yourButton').setDisabled(true);
}
else {
Ext.getCmp('yourButton').setDisabled(false);
}
}
}
あなたはコンポーネントのレンダリングが終了した後afterrenderそれは意志戦火を使用してきたようにすべてのヘルプは大
使用を働いているか、ここで確認してください。 –