1. #61
    Sencha User
    Join Date
    Jun 2013
    Posts
    26
    Vote Rating
    0
    mkm_2013 is on a distinguished road

      0  

    Default Combobox in dynamicGrid

    Combobox in dynamicGrid


    Thanks for you reply . I have solved the problem of putting combo in dynamicgrid.I used storeid attribute.

  2. #62
    Sencha Premium Member
    Join Date
    Nov 2013
    Posts
    35
    Vote Rating
    1
    tdobberphul is on a distinguished road

      0  

    Default DynamicGrid.js doesn't work with extjs4.2

    DynamicGrid.js doesn't work with extjs4.2


    I have a problem:
    The 'metachange'-event is never fired so nothing is shown. Everything else works fine (json-loading etc.). Everything is ready, waiting for the metachange event.

    Perhaps there was an extjs - change in 2014 ?
    It seems as if the metaData - property is read-only ?! So one can set it in the code but it will not change and so there is no event fired?

    Please help,
    Tobias

  3. #63
    Sencha Premium Member
    Join Date
    Nov 2013
    Posts
    35
    Vote Rating
    1
    tdobberphul is on a distinguished road

      0  

    Default


    Problem ExtJS 4.2 metachange-event not thrown solved with this workaround:
    Use load-event instead:
    Code:
    /**
     * Lukas Sliwinski
     * sliwinski.lukas@gmail.com
     *
     * Dynamic grid, allow to display data setting only URL.
     * Columns and model will be created dynamically.
     */
    
    
    Ext.define('Ext.ux.grid.DynamicGrid', {
        extend: 'Ext.grid.Panel',
        alias: 'widget.dynamicGrid',
        alternateClassName: 'Ext.grid.DynamicGrid',
        
        // URL used for request to the server. Required
        url: '',
        visibleColumns: null,
    
    
        initComponent: function() {
            console.log('DynamicGrid initComponent!');
            var me = this;
    
    
            if (me.url == '') {
                Ext.Error.raise('url parameter is empty! You have to set proper url to get data form server.');
            }
            else {
                Ext.applyIf(me, {
                    columns: [],
                    forceFit: true,
                    store: Ext.create('Ext.data.Store', {
                        // Fields have to be set as empty array. Without this Ext will not create dynamic model.
                        fields: [],
                        // After loading data grid have to reconfigure columns with dynamic created columns
                        // in Ext.ux.data.reader.DynamicReader
                        listeners: {
                            /*
                            'metachange': function(store, meta) {
                                me.reconfigure(store, meta.columns);
                            },*/
    'load': function(store, records, successful, eOpts) {
                                me.reconfigure(store, store.getProxy().getReader().metaData.columns);
                            }
                        },
                        autoLoad: true,
                        remoteSort: false,
                        remoteFilter: false,
                        remoteGroup: false,
                        proxy: {
                            reader: Ext.create('Ext.ux.data.reader.DynamicReader', {
                                visibleColumns: me.visibleColumns
                            }),
                            type: 'rest',
                            url: me.url
                        }
                    })
                });
            }
    
    
            me.callParent(arguments);
        }
    });

  4. #64
    Sencha User
    Join Date
    Jun 2012
    Posts
    33
    Vote Rating
    14
    plum will become famous soon enough

      0  

    Default


    tdobberphul, thanks for workaround. I created branch on github repo with this code:
    https://github.com/nonameplum/Dynami...e/extjs4.2-fix