【发布时间】:2017-11-02 12:37:57
【问题描述】:
为了在 extjs 中启用或禁用保存按钮,我做了一个简单的例子:
var panelData = [first = 'true', second = "false"]
TestFormPanel = new Ext.form.FormPanel({
title: 'TestPanel',
data: panelData,
buttons: [
new Ext.Button({
id: 'saveButton',
text: 'save',
scope: this,
disabled: true,
handler: function () {
panelData = this.getForm().getValues();
console.log(panelData);
}
})],
defaults: {
xtype: 'checkbox',
listeners: [{
check: function () {
console.log('check');
this.saveButton.enable();
}
}]
},
items: [
{
name: 'first',
fieldLabel: 'first box'
},
{
name: 'second',
fieldLabel: 'second box'
}
]
});
Ext.onReady(function () {
console.log('started');
TestFormPanel.render(document.body)
})
check 事件永远不会被触发。我尝试了许多其他侦听器,例如 click、containerclick 或 select 均未触发。 我可以检测到复选框的变化吗?
【问题讨论】:
标签: javascript user-interface extjs3