0

Sencha touch 2.1 アプリの NestedList の detailsCard 内に Ext.Audio コンポーネントがあります。detailsCard で [戻る] ボタンをタップしたときにオーディオ ストリームを停止する方法がわかりません。また、detailsCardの戻るボタンだけの「戻るボタンタップイベント」を聞く方法もわかりません。これが私のコードです:

Ext.define('App.view.Lead', {
extend: 'Ext.NestedList',
xtype: 'lead',
config: {
   title: 'Lead',
   iconCls:'lead',
       store: 'LeadStore',
   displayField: 'title',
   detailCard: { html: 'details' }
},
getDetailCard: function(node) {
          if (node) {
              return {
                  xtype: 'container',
                  layout: 'fit',
                  items: [
                      {
                          xtype: 'panel',
                          layout:'fit',
                          html: node.get('text')     
                      },
                      {               
                          xtype: 'audio',
                          docked: 'bottom',
                          url  : node.get('audio'),
                          autoPause: true,
                      },
                      ]
              }
          } 
     }

});

前もって感謝します

4

1 に答える 1

1

オーディオに参照用の設定を与えることができますid:

{               
    xtype: 'audio',
    docked: 'bottom',
    url  : node.get('audio'),
    autoPause: true,
    id: 'audio'
}

戻るボタンを処理するには、ネストされたリストのbackイベントとstopメソッドを使用してオーディオを停止できます。

back: function() {
    Ext.getCmp('audio').stop();
}

を使えば安心ですitemId

itemId: audio

次に、Ext.ComponentQueryを使用して取得できます。

Ext.ComponentQuery.query('#audio')[0].stop();
于 2013-02-25T06:18:46.300 に答える