How to configure store for combobox in custom shopping world element?

displayField - contain info, which should be visible for customer.

valueField - contain info, which should be send to server as selected value.

As example:

_Ext_. **create** ( **'Ext.form.field.ComboBox'** , { **xtype** : **'combobox'** , **triggerAction** : **'all'** , **name** : **'approve'** , **fieldLabel** :me. **snippets**. **toolbar**. **type** , **store** : _Ext_. **create** ( **'Ext.data.Store'** , { **fields** : [**'id'** , **'type'**], **data** : [{ **"id"** : 0, **"type"** : **'Awaiting'** }, { **"id"** : 1, **"type"** : **'Approved'** }] }), **value** : 0, **labelWidth** : 40, **width** : 150, **emptyText** : me. **snippets**. **toolbar**. **awayting** , **listeners** : { change: **function** (field, value) { me.searchApproveEvent(field, value); } }, **valueField** : **'id'** , **displayField** : **'type'** , **enableKeyEvents** : **true** , **checkChangeBuffer** :500 });

So there is only 2 columns - id and type - you set for display column type and column id as value.

For example you can see themes/Backend/ExtJs/backend/config/view/form/document.js

 { **name** : **'numbers'** , **xtype** : **'config-element-select'** , **valueField** : **'name'** , **displayField** : **'description'** , **store** : **'Shopware.apps.Config.store.form.Number'** , **fieldLabel** : **'{s name=document/detail/numbers\_label}Numbers{/s}'** }

http://joxi.ru/DmBLBQ8SwXOBnA

1 „Gefällt mir“