0

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を渡すことはできますか?*

助けて

パヴァン

4

1 に答える 1

0

panel.setHtml を使用して、ストアから取得した変数から html を更新しました。

ありがとう

于 2013-02-19T02:33:42.897 に答える