Skip to content

Commit 29cbe53

Browse files
Merge pull request #3778 in SW/shopware from sw-15412/5.2/merge-base-and-config-combobox to 5.2
* commit 'c301e70a2eacd1b5c99fc5fa6fb1ca714906740e': SW-15412 - Merge config and base combobox and ensure usage of unique store instance
2 parents b12c51c + c301e70 commit 29cbe53

File tree

2 files changed

+8
-51
lines changed

2 files changed

+8
-51
lines changed

UPGRADE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ In this document you will find a changelog of the important changes related to t
398398
* `\Shopware\Bundle\StoreFrontBundle\Struct\ProductContext`
399399
* `\Shopware\Bundle\StoreFrontBundle\Struct\LocationContextInterface`
400400
* `\Shopware\Bundle\StoreFrontBundle\Struct\ProductContextInterface`
401-
401+
* Added support for loading a new store instance by ID in the config combo box `Shopware.apps.Config.view.element.Select`
402402

403403
## 5.1.6
404404
* The interface `Enlight_Components_Cron_Adapter` in `engine/Library/Enlight/Components/Cron/Adapter.php` got a new method `getJobByAction`. For default implementation see `engine/Library/Enlight/Components/Cron/Adapter/DBAL.php`.

themes/Backend/ExtJs/backend/config/view/element/select.js

Lines changed: 7 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,15 @@
1919
* The licensing of the program under the AGPLv3 does not imply a
2020
* trademark license. Therefore any rights, title and interest in
2121
* our trademarks remain entirely with us.
22-
*/
23-
24-
/**
25-
* todo@all: Documentation
22+
*
23+
* @category Shopware
24+
* @package Config
25+
* @subpackage Component
26+
* @version $Id$
27+
* @author shopware AG
2628
*/
2729
Ext.define('Shopware.apps.Config.view.element.Select', {
28-
extend:'Ext.form.field.ComboBox',
30+
extend:'Shopware.apps.Base.view.element.Select',
2931
alias:[
3032
'widget.config-element-select',
3133
'widget.config-element-combo',
@@ -34,56 +36,11 @@ Ext.define('Shopware.apps.Config.view.element.Select', {
3436
],
3537

3638
queryMode:'remote',
37-
forceSelection: false,
38-
editable: true,
39-
valueField: 'id',
40-
displayField: 'name',
4139

4240
initComponent:function () {
4341
var me = this;
4442

45-
if (me.controller && me.action) {
46-
//me.value = parseInt(me.value);
47-
me.store = new Ext.data.Store({
48-
url:'{url controller=index}/' + me.controller + '/' + me.action,
49-
autoLoad:true,
50-
reader:new Ext.data.JsonReader({
51-
root:me.root || 'data',
52-
totalProperty:me.count || 'total',
53-
fields:me.fields
54-
})
55-
});
56-
// Remove value field for reasons of compatibility
57-
me.valueField = me.displayField;
58-
}
59-
// Eval the store string if it contains a statement.
60-
if (typeof(me.store) == 'string' && me.store.indexOf('new ') !== -1) {
61-
//me.value = parseInt(me.value);
62-
eval('me.store = ' + me.store + ';');
63-
// Remove value field for reasons of compatibility
64-
me.valueField = me.displayField;
65-
}
66-
6743
me.callParent(arguments);
6844
me.queryCaching = (me.store.$className == 'Ext.data.ArrayStore');
69-
},
70-
71-
setValue:function (value) {
72-
var me = this;
73-
74-
if (value !== null && !me.store.loading && me.store.getCount() == 0) {
75-
me.store.load({
76-
callback:function () {
77-
if(me.store.getCount() > 0) {
78-
me.setValue(value);
79-
} else {
80-
me.setValue(null);
81-
}
82-
}
83-
});
84-
return;
85-
}
86-
87-
me.callParent(arguments);
8845
}
8946
});

0 commit comments

Comments
 (0)