# Attribut im Backend im positionGrid speichern

**URL:** <https://forum.shopware.com/t/attribut-im-backend-im-positiongrid-speichern/43778>\
**Category:** Programmierung\
**Created:** [16. Februar 2017 um 15:17 UTC](https://forum.shopware.com/t/attribut-im-backend-im-positiongrid-speichern/43778 "2017-02-16T15:17:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![megadruck](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@megadruck](https://forum.shopware.com/u/megadruck)\
**Post date:** [16. Februar 2017 um 15:17 UTC](https://forum.shopware.com/t/attribut-im-backend-im-positiongrid-speichern/43778/1 "2017-02-16T15:17:22Z")

</div>

Hallo

Ich speichere im Backend in der BEstellung unter Positionen die Spalte um ein Attribute erweitert welches eine checkbox als Editor aufweist.

Dazu habe ich mich an die Anleitung von  
[Attribute system](https://developers.shopware.com/developers-guide/attribute-system/)

gehalten und den Controller&nbsp;

```
**Shopware.apps.Order.controller.Detail'**

```

erweitert.

Soweit war die Umsetzung auch recht einfach und alles funktioniert auch soweit.

Das einzige Problem ist, dass beim Refresh des Grid Rows den Text der Checkbox (TrueText /FalseText nicht gesetzt bekomme.

&nbsp;

```
    onSavePosition: function(editor, e, store, options) {
        var me = this;

        originalCallback = options.callback;
        if ((e.newValues.md_express != e.originalValues.md_express) && e.record.internalId > 0) {
                var customCallback = function (position, success) {
                    Ext.callback(originalCallback, this, arguments);
                    Ext.Ajax.request({
                        method: 'POST',
                        url: '{url controller=AttributeData action=saveData}',
                        params: {
                            _foreignKey: e.record.internalId,
                            _table: 's_order_details_attributes',
                            __attribute_md_express: Number(e.newValues.md_express)
                        },
                        success: function(response){
                            //reload of the orderList Grid
                            me.getOrderList().store.load();

                            //reload the grid row of position
                            var selectedRowIndex=e.grid.getSelectionModel().getCurrentPosition().row;
                            var selectedRowRecord=e.grid.getStore().getAt(selectedRowIndex);
                            selectedRowRecord.set('md_express',Number(e.newValues.md_express));
                            selectedRowRecord.commit();

                        }
                    });
                };
            if (!options.callback || options.callback.toString() !== customCallback.toString()) {
                options.callback = customCallback;
            }

        }
        me.callParent([editor, e, store, options]);
    }

```

&nbsp;

---

<div class="post-metadata">

**Author:** ![megadruck](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@megadruck](https://forum.shopware.com/u/megadruck)\
**Post date:** [17. Februar 2017 um 09:35 UTC](https://forum.shopware.com/t/attribut-im-backend-im-positiongrid-speichern/43778/2 "2017-02-17T09:35:12Z")

</div>

Fehler gefunden. Lag am Callback.
