Проблема с параметром baseParams

Постигаю азы extJs и все бы ни чего, но совершенно завис на одной вещи и ни как не могу продвинутся вперед, уже 4 час к ряду. Может сможет кто помочь? Буду крайне благодарен. Вопрос в следующем. Я с помощью categoryFilterMigx засылаю данные с modx-combo в filterMigx-grid-items и даже в первый раз прикрученный baseParams.parent улетает в запрос, но потом значение в Ext.getCmp('filterMigx-grid-items').baseParams.parent ни как не желает менятся, не могу понять в чем дело. При чем данные в modx-combo выбираются верно, но значение не меняется.
var filterMigx = function (config) {
    config = config || {};
    filterMigx.superclass.constructor.call(this, config);
};
Ext.extend(filterMigx, Ext.Component, {
    page: {}, window: {}, grid: {}, tree: {}, panel: {}, combo: {}, config: {}, view: {}, utils: {}
});
Ext.reg('filterMigx', filterMigx);

filterMigx = new filterMigx();


filterMigx.grid.Items = function(config) {
    config = config || {};

    this.sm = new Ext.grid.CheckboxSelectionModel();

    Ext.applyIf(config,{
        id: 'filterMigx-grid-items'
        ,url: '/core/components/filtermigx/connectors/filterlist.php'
        ,baseParams: {}
        ,fields: ['id','pagetitle','parent','price','oldprice','filters']
        ,autoHeight: true
        ,paging: true
        ,remoteSort: true
        ,width: '97.1%'
        ,sm: this.sm
        ,columns: [this.sm,{
            header: 'Id'
            ,dataIndex: 'id'
        },{
            header: 'Заголовок'
            ,dataIndex: 'pagetitle'
        },{
            header: 'Родитель'
            ,dataIndex: 'parent'
        },{
            header: 'Цена'
            ,dataIndex: 'price'
        },{
            header: 'Старая цена'
            ,dataIndex: 'oldprice'
        },{
            header: 'Фильтры'
            ,dataIndex: 'filters'
        }]
        ,tbar: [{
            id: 'categoryFilterMigx'
            ,xtype: 'modx-combo'
            ,emptyText: 'Выберите категорию'
            ,width: 300
            ,displayField: 'pagetitle'
            ,valueField: 'id'
            ,store: new Ext.data.JsonStore({
                url: '/core/components/filtermigx/connectors/categorylist.php'
                ,fields: ['id','pagetitle']
                ,root: 'results'
            })
            ,listeners: {
                select: {
                    fn: function() {
                        Ext.getCmp('filterMigx-grid-items').baseParams.parent = Ext.getCmp('categoryFilterMigx').value;
                        Ext.getCmp('filterMigx-grid-items').refresh();
                    }
                    ,scope: this
                }
            }
        }]
    });
    filterMigx.grid.Items.superclass.constructor.call(this,config);
};

Ext.extend(filterMigx.grid.Items,MODx.grid.Grid,{
    windows: {}
});

Ext.reg('filterMigx-grid-items',filterMigx.grid.Items);

filterMigx.panel.Home = function(config) {
    config = config || {};
    Ext.apply(config,{
        border: false
        ,baseCls: 'modx-formpanel'
        ,cls: 'container'
        ,items: [{
            html: ''
            ,border: false
            ,cls: 'modx-page-header'
        },{
            xtype: 'modx-tabs'
            ,defaults: { border: false ,autoHeight: true }
            ,border: true
            ,activeItem: 0
            ,hideMode: 'offsets'
            ,items: [{
                title: 'Фильтры'
                ,items: [{
                    html: '<p>Редактирование фильтров товаров.</p>'
                    ,border: false
                    ,bodyCssClass: 'panel-desc'
                },{
                    xtype: 'filterMigx-grid-items'
                    ,preventRender: true
                    ,cls: 'main-wrapper'
                }]
            }]
        }]
    });
    filterMigx.panel.Home.superclass.constructor.call(this,config);
};
Ext.extend(filterMigx.panel.Home,MODx.Panel);
Ext.reg('filterMigx-panel-home',filterMigx.panel.Home);

Ext.onReady(function() {
    MODx.load({ xtype: 'filterMigx-page-home'});
});

filterMigx.page.Home = function(config) {
    config = config || {};
    Ext.applyIf(config,{
        components: [{
            xtype: 'filterMigx-panel-home'
            ,renderTo: 'ext-gen18'
        }]
    });
    filterMigx.page.Home.superclass.constructor.call(this,config);
};
Ext.extend(filterMigx.page.Home,MODx.Component);
Ext.reg('filterMigx-page-home',filterMigx.page.Home);
Павел Карелин
22 июня 2016, 21:14
modx.pro
1 998
0

Комментарии: 5

Володя
23 июня 2016, 00:28
+1
Ext.getCmp('filterMigx-grid-items').refresh();
попробуй заменить на reload()
    Павел Карелин
    23 июня 2016, 13:20
    0
    TypeError: Ext.getCmp(...).reload is not a function
    Видимо такого метода нет((
    Павел Карелин
    23 июня 2016, 00:33
    0
    Заменил событие выбора на:
    var s = this.getStore();
    s.baseParams.parent = Ext.getCmp('categoryFilterMigx').value;
    this.getBottomToolbar().changePage(1);
    this.refresh();
    И все вроде начало работать, но отправляет 2 запроса один из которых битый.
      Василий Наумкин
      23 июня 2016, 07:12
      +1
      Нужно вызывать или
      this.getBottomToolbar().changePage(1);
      или
      this.refresh();

      Они оба перезагружают таблицу, но первый еще и переключает её на первую страницу сначала.
        Павел Карелин
        23 июня 2016, 13:22
        0
        Спасибо огроменное, действительно
        this.getBottomToolbar().changePage(1);
        дает тот самый результат который требуется.
      Авторизуйтесь или зарегистрируйтесь, чтобы оставлять комментарии.
      5