docs: lto barcod generator: disable add button when fields are not valid
otherwise we end up with entries in the list that won't be displayed/printed anyway. Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
28565852e7
commit
0a34b9b96d
@ -46,6 +46,23 @@ Ext.define('LabelSetupPanel', {
|
||||
let params = view.getValues();
|
||||
list.getStore().add(params);
|
||||
},
|
||||
|
||||
validitychange: function() {
|
||||
let me = this;
|
||||
let isValid = true;
|
||||
me.getView().query('field').forEach((field) => {
|
||||
if (!field.isValid()) {
|
||||
isValid = false;
|
||||
}
|
||||
});
|
||||
me.lookup('addButton').setDisabled(!isValid);
|
||||
},
|
||||
|
||||
control: {
|
||||
'field': {
|
||||
validitychange: 'validitychange',
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
items: [
|
||||
@ -93,6 +110,7 @@ Ext.define('LabelSetupPanel', {
|
||||
{
|
||||
xtype: 'button',
|
||||
text: 'Add',
|
||||
reference: 'addButton',
|
||||
handler: 'onAdd',
|
||||
},
|
||||
],
|
||||
|
Loading…
Reference in New Issue
Block a user