1

Есть такой вывод данных с базы

initComponent: function() {
        Ext.apply(this, {
            items: [{
                xtype: 'grid',
                hideCollapseTool: true,
                columnLines: true,
                viewConfig: {
                    stripeRows: true
                },
                tbar: [{
                    scope: this,
                    handler: this.onAddClick,
                    tooltip: 'Обновить',
                    tooltipType: 'title',
                    iconCls:'refresh-icon'
                },
                {
                    scope: this,
                    iconCls:'download-icon',
                    disabled: true,
                    tooltip: 'Загрузить',
                    tooltipType: 'title',
                    handler: this.onAddClick
                }],
                store: 'TelCatalogStore',
                columns: [{
                    text     : 'Имя',
                    flex     : 1,
                    sortable : true,
                    dataIndex: 'name'
                },
                {
                    text     : 'Тип',
                    sortable : false,
                    dataIndex: 'type'
                },
                {
                    text     : 'Дата',
                    sortable : false,
                    dataIndex: 'data'
                },
                {
                    text     : 'Статус',
                    width    : 75,
                    sortable : false,
                    renderer : this.changeRenderer,
                    dataIndex: 'status'
                }]
            }]
        });
        this.callParent();
    }

Я добавил сюда такую кнопку

tbar: [{
                    scope: this,
                    handler: this.onAddClick,
                    tooltip: 'Обновить',
                    tooltipType: 'title',
                    iconCls:'refresh-icon'
                }

Как написать функцию что бы когда нажимаешь на кнопку таблица обновлялась?

3
  • За что минус то а? 15 сен 2015 в 5:06
  • 1
    Я полагаю, что минус за "напишите за меня". SO сделан не для этого. Для подобных просьб надо идти на тематические форумы, в данном случае на форум sencha.
    – SlyDeath
    15 сен 2015 в 5:38
  • Спасибо буду знать 15 сен 2015 в 5:41

2 ответа 2

1
this.getViewName.getStore.load();

обновляет store

0
onAddClick: function(me) {
 this.down('grid').getStore().load();
}

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.