【问题标题】:sencha touch-2; Store values into HTML煎茶触摸2;将值存储到 HTML
【发布时间】:2013-02-18 22:03:56
【问题描述】:

我有一个商店和模型来进行 AJAX 调用并获得结果。

这是我的观点

Ext.define('kids.view.YouTube', {
  extend: 'Ext.Component',
  alias: 'widget.YouTubePlayer',
  xtype: 'YouTube',

  config: {
    url: 'http://www.youtube.com/embed/',
    videoId: 'qsvpvqvApKo',
    vWidth: 420,
    vHeight: '315',
    styleHtmlContent: true,
    aaa: '1',
},
initialize: function() {
    var prod = Ext.create('kids.store.vids');
    prod.load(function ( ){ 
    prod.each(function (record, id){
        tmp = tmp + record.get('vid_url');
 });

  });
 this.callParent(arguments);
    var out = Ext.String.format(
      [
        '<div align="center">',
        '<iframe width="{0}" height="{1}" src="{2}"',
        'frameborder="0" allowfullscreen></iframe>',
        '</div>'
      ].join(''),
      this.getVWidth(),
      this.getVHeight(),
      **tmp //(the dynamic variable i formed in onLoad event of store**
    );
    console.log(tmp);

   this.setHtml(out);
}
 });

我用prod=ext.create('kids.store.vids'); 我正在使用onload 函数,它可以正确获取值。

我如何在 onload 之外使用 tmp 变量,因为该变量正在变为空。在 store.load(function) 里面我不能使用this.callParent()

h*我可以在这里传递动态 html,根据商店返回的值吗?*

帮帮我

帕万

【问题讨论】:

    标签: sencha-touch-2 sencha-architect


    【解决方案1】:

    知道了,谢谢 我已经使用 panel.setHtml 从我从商店获得的变量中更新了 html。

    谢谢

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-01-11
      • 2011-12-25
      • 2012-11-04
      • 1970-01-01
      相关资源
      最近更新 更多