comment inline

On 7/14/26 9:56 AM, Daniel Kral wrote:
[ snip ]

+
+    getErrors: function (value) {
+        let me = this;
+
+        if (!me.isDisabled() && me.allowBlank === false && 
me.getValue().length === 0) {
+            me.addBodyCls(['x-form-trigger-wrap-default', 
'x-form-trigger-wrap-invalid']);
+            return [gettext('No nodes selected')];
Not sure if this returned text is visible in the UI. I played around with it 
and the grid turned
red if no node is selected, but due to the fact that the "Add" button is 
disabled anyways this
message will never appear, but it does not hurt either.

Yeah, this was also taken from the VMSelector component... The nodes
field is required here and probably will always be for the node priority
selector.

+        }
+
+        me.removeBodyCls(['x-form-trigger-wrap-default', 
'x-form-trigger-wrap-invalid']);
+
+        return [];
+    },

Not sure if I like this approach. I tried to look for better solutions but it 
seems like
there is no extjs native way to handle this.

What approach are you referring to exactly?


I meant the way getErrors adds side effects by adding/removing CSS classes to 
highlight
the error in the grid [0]. However, as you mentioned, this seems to be an 
established way
of handling it here, since it's already done this way in the VMSelector 
component [1].

[0] 
https://docs.sencha.com/ext/7.0.0/api/Ext.form.CheckboxGroup.html#method-getErrors
[1] 
https://git.proxmox.com/?p=pve-manager.git;a=blob;f=www/manager6/form/VMSelector.js;h=a9e90b04e43b560c7c4ef8c9735f52b1035348dd;hb=b0b650c16c520eaaf62db54810dcf8d66bc4249f#l197


+
+    initComponent: function () {
+        let me = this;
+
+        me.callParent();
+        me.initField();
+    },
+});
[ snip ]




Reply via email to