Quantcast
Channel: Programming - Shopware Community Forum
Viewing all articles
Browse latest Browse all 118

Extjs Artikel Suche

$
0
0
Hallo,

aus meinem "Model" wird eine Form mit Feldern generiert.
Wie kann ich statt dem normalem Eingabe Feld, ein Artikel Suchfeld anzeigen lassen?

//model/main.js
Ext.define('Shopware.apps.Test.model.Main', {
    extend: 'Shopware.data.Model',

    configure: function() {
        return {
            controller: 'Test',
            detail: 'Shopware.apps.Test.view.detail.Container'
        };
    },

    fields: [
        { name: 'id', type: 'int', useNull: true },
        { name: 'number', type: 'string', useNull: false}
    ]
});
//view/detail/container.js
Ext.define('Shopware.apps.Test.view.detail.Container', {
    extend: 'Shopware.model.Container',
    padding: 20,

    configure: function() {
        return {
            controller: 'Test'
        };
    },
});

//Bsp.:
createArticleSearch: function() {
    var me = this;

    return Ext.create('Shopware.form.field.ArticleSearch', {
        name: 'number',
        fieldLabel: me.snippets.articleSearch,
        returnValue: 'name',
        hiddenReturnValue: 'number',
        articleStore: Ext.create('Shopware.store.Article'),
        allowBlank: false,
        getValue: function() {
            return this.getSearchField().getValue();
        },
        setValue: function(value) {
            this.getSearchField().setValue(value);
        }
    });
},

Viewing all articles
Browse latest Browse all 118

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>