1
votes

I have a problem... I am using sencha architect for client side and asp.net Mvc for server side. I'd like a custom plugin in my grid from controller because with sencha architect i cant add custom plugin. How i can make this.? Sorry for my english

2

2 Answers

0
votes

Here's an example of how this can be done; hope you can work it out from here:

Ext.define('BS.app.TabController', {   
    extend: 'Ext.app.Controller',

    viewConfig: {
        plugins: [{
            ptype: 'formeditor',
            store: 'Groups'
        },{
            ptype: 'formtooltips'
        }]    
    },

    init: function()
    {
        this.callParent();

        // The dynamically created view is stored as a property
        this.view = this.getView(this.views[0]).create( this.viewConfig );        
    },
});
0
votes

thank you for your help, but i need add plugin in the my grid from controller. if i use this :

  Ext.define('MyApp.controller.ArticoliListaController', {
    extend: 'Ext.app.Controller',
    stores: ['ArticoloStore'],
    models: ['articoloData'],
    views: ['articoli.ListaArticoli'],
    viewConfig: {
        plugins: [{
            ptype: 'filterbar',
            renderHidden: false,
            showShowHideButton: true,
            showClearAllButton: true
        }]
    },
    init: function () {
       // this.view = this.getView(this.views[0]).create(this.viewConfig);
        this.control(
                {

                    '#listaArticoli #btnInserisci':
                    {
                        click: this.inserisciClick
                    },
                    '#listaArticoli #grdListaArticoli': {

                        afterrender: function (gridview) {
                            Ext.getCmp("listaArticoli").down("#grdListaArticoli").getStore().load();
                            Ext.getCmp("listaArticoli").down("#grdListaArticoli").create(this.viewConfig);//not work                        },
                        celldblclick: function (tableview, td, cellIndex, record, tr, rowIndex, e, eOpts) {
                            Ext.create('MyApp.view.articoli.InsArticoli', { rIx: rowIndex }).show();
                        }

                    }

                });

    },

    inserisciClick: function (e) {
        Ext.create('MyApp.view.articoli.InsArticoli').show();
    }
});

the code not work. it will wrong because i dont use... i have try :

......
    '#listaArticoli #grdListaArticoli': {
                            afterrender: function (gridview) {
                                getWin("listaArticoli", "#grdListaArticoli").getStore().load();

                                var filterRow = new Ext.ux.grid.FilterBar({
                                    ptype: 'filterbar',
                                    renderHidden: false,
                                    showShowHideButton: true,
                                    showClearAllButton: true
                                });


                                filterRow.init(gridview);
                                gridview.plugins.push(filterRow);
                            },
    ....

but i receive an erro from log "Uncaught TypeError: Cannot call method 'push' of undefined ". i dont understand