0

Возникли сложности при отрисовке items компонента Ext.form.Panel.

Вот код:

Ext.define('Client.help.News', {
    extend: 'Ext.form.Panel',
    xtype: 'help_news',

    title: 'Новости',
    bodyPadding: 20,
    layout: 'accordion',
    items: [],

    initComponent: function () {
        var me = this;
        this.store = Ext.create('Client.store.News');   
        this.store.load({
            scope: this,
            callback: function() {
                me.store.each(function(record) {
                    me.items.add({
                        title: record.get('title'),
                        html: record.get('text')
                    });
                }); 
            }
        });
        this.callParent(arguments);             
    }
});

Не понимаю как добавить данные после загрузки из store в items. Очень прошу помочь.

1 ответ 1

-1

Нужно было вызвать me.add вместо me.items.add, так как этот метод у Panel а не у массива items.

Ваш ответ

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

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