diff --git a/docs/lto-barcode/label-setup.js b/docs/lto-barcode/label-setup.js index e65cc7a41..b42a30800 100644 --- a/docs/lto-barcode/label-setup.js +++ b/docs/lto-barcode/label-setup.js @@ -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', }, ],