我是 sencha 的新手,我正在尝试填充一些模板,如下所示:
模型:
Ext.define("GS.model.Oferta", {
        extend : 'Ext.data.Model',
        config : {
            fields : [{
                        name : "type",
                        type : "string"
                    }, {
                        name : "logo",
                        type : "string"
                    }, {
                        name : "description",
                        type : "string"
                    }, {
                        name : "product",
                        type : "string"
                    }]
        }
    });
店铺:
Ext.define("GS.store.BoxStore", {
        extend : 'Ext.data.Store',
    config: {
        storeId: 'boxStore',
        model : 'GS.model.Oferta',
        proxy : {
            type : 'ajax',
            url : 'TestData.json',
                reader: {
                    type:'json',
                    rootProperty: 'dataArr'
                }
        },
        autoLoad : true
    }
    });
模板:
Ext.define("GS.view.Box", {
        extend : 'Ext.Panel',
        requires : ['Ext.form.FieldSet'],
        layout : {
            type : 'absolute'
        },
        config : {
            tpl : Ext.XTemplate.from('tp1'),
            data:{}
        }
    });
控制器:
Ext.define('GS.controller.Main', {
 extend: 'Ext.app.Controller',
store: 'boxStore',
config : {
    stores: ['BoxStore'],
    models: ['Oferta'],
    refs : {????
    ????????    },
    control : {
??????????
        }
    }
},
    getData: function(list, index, element, record){
    this.getBox().push({
        xtype: 'panel',
        data :[record.get('type'), record.get('logo'), record.get('logo'),     record.get('product')],
        scrollable: true,
        styleHtmlContent: true
    });
},
//called when the Application is launched, remove if not needed
launch: function(app) {
}
});
HTML:
            <textarea id='tp1' class="tp1">
           <div class="product_small">
             <div class="type" id"type">
             </div>
             <div class="logo"><img src="resources/images/garbarino_logo.png" />
             </div>
             <div class="small_description">
                    Lorem ipsum dolor sit amet, consectetur adipiscing elit.
             </div>
             <div class="product">
                 <span style="color:rgb(0,193,209); font:bold 35px/40px Tahoma,Verdana;">1.700</span><span style="color:rgb(0,193,209); font:bold 13px/20px Tahoma,Verdana;"> puntos</span>
             </div>
            </div>
        </textarea>
我如何设法填充模板?我应该尝试在控制器中创建一个盒子并将其设置在那里吗?
非常感谢伊格纳西奥