]> git.proxmox.com Git - proxmox-widget-toolkit.git/commitdiff
fix usage of findRecord
authorDominik Csapak <d.csapak@proxmox.com>
Thu, 26 Nov 2020 08:23:39 +0000 (09:23 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 26 Jan 2021 17:54:18 +0000 (18:54 +0100)
findRecord does not match exactly, but only at the beginning and
case insensitive, by default. Change all calls to be case sensiti
and an exactmatch (we never want the default behaviour afaics).

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
src/form/ComboGrid.js
src/form/RealmComboBox.js

index 20c94556491a69d42b0f8656bcba10907d1d0b69..07ea5fe4b0bdc6fd88311061adb2fccee3ce9cc6 100644 (file)
@@ -346,14 +346,14 @@ Ext.define('Proxmox.form.ComboGrid', {
 
        if (Ext.isArray(value)) {
            Ext.Array.each(value, function(v) {
-               if (store.findRecord(me.valueField, v)) {
+               if (store.findRecord(me.valueField, v, 0, false, true, true)) {
                    found = true;
                    return false; // break
                }
                return true;
            });
        } else {
-           found = !!store.findRecord(me.valueField, value);
+           found = !!store.findRecord(me.valueField, value, 0, false, true, true);
        }
 
        return found;
index 309bf4fd8fa7278172fcb185dc56ed915cbdfb25..5f616873860272ae55b287920d90ce7e99df56dd 100644 (file)
@@ -15,7 +15,7 @@ Ext.define('Proxmox.form.RealmComboBox', {
            }
            let me = this;
            let val = me.getValue();
-           if (!val || !me.store.findRecord('realm', val)) {
+           if (!val || !me.store.findRecord('realm', val, 0, false, true, true)) {
                let def = 'pam';
                Ext.each(records, function(rec) {
                    if (rec.data && rec.data.default) {