【问题标题】:Sencha Touch dataview and initialize doesnt work togetherSencha Touch 数据视图和初始化不能一起工作
【发布时间】:2013-03-21 08:44:18
【问题描述】:

我的代码有问题。我想使用 Sencha Touch DataView 并且一切正常,直到我尝试放置初始化事件。当我把它初始化时,我的数据视图无法生成。这是我的代码。你能帮我吗:)?

Ext.define("xxx.view.Spread", {
extend: 'Ext.DataView',
xtype: 'xxxspread',
id: 'spreadForm',   
config : {
    styleHtmlContent: true,
    store: {
        //autoLoad: true,
        fields: ["name", "desc"],
        data: [
            {name: 'test',  desc: "testtest"},
            {name: 'test',  desc: "test"},
        ],
    },


    itemTpl: '<img src="https://si0.twimg.com/profile_images/1089012240/sencha-logo_normal.png" /><h1>{name}</h1><p>{desc}</p><div style="clear: both"></div>',

},  

initialize: function() {
    console.log("init");
},


});

【问题讨论】:

    标签: extjs initialization touch dataview


    【解决方案1】:

    您必须为您的listeners 进行配置,并在那里捕获initialize 事件。

    config: {
        styleHtmlContent: true,
        store : ...
        //More config here
        listeners: {
            initialize: function() { console.log('init'); }
        }
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-11-29
      • 2012-05-01
      • 1970-01-01
      相关资源
      最近更新 更多