2012-12-21 48 views
1

我需要爲我的sencha touch項目實現qr代碼。 這是我以前的教程。 http://simonmacdonald.blogspot.com/2011/12/installing-barcode-plugin-for-phonegap.html將Qr代碼與sencha touch集成

我按照教程和phonegap插件在我的手機中工作得很好。但是,如果我有一個問題。我可以自定義佈局並將插件實施到我的sencha touch項目中嗎?

例如,當我點擊會員資料按鈕時,會出現條碼掃描器。

這是我的代碼。

Ext.define('bluebutton.view.BlueButton.MemberPopUp', { 
extend: 'Ext.Panel', 
xtype: 'memberpopup', 

requires: [ 
    'Ext.form.Panel', 
    'Ext.form.FieldSet', 
    'Ext.field.Text', 
    'bluebutton.view.BlueButton.MemberDetail' 

], 

config: { 


    items: [ 
       { 
        docked: 'top', 
        xtype: 'titlebar', 
        items: [ 
         { 
          xtype: 'button', 
          text: 'Member Profile' 
         }, 
          { 
           xtype: 'button', 
           text: 'Transaction History' 
          } 
         ] 
       }, 
       { 
        html : '<div align="center"> <img src="/bluebutton/resources/images/user2.png" alt="Smiley face" height="150" width="150" border="5"> </div>' 


       } 
      ] 

} 

});

請幫忙。在此先感謝

回答

1

1)你可以使用導航視圖

例:

var view = Ext.create('Ext.NavigationView', { 
fullscreen: true, 

items: [{ 
    title: 'First', 
    items: [{ 
     xtype: 'button', 
     text: 'Push a new view!', 
     handler: function() { 
      //use the push() method to push another view. It works much like 
      //add() or setActiveItem(). it accepts a view instance, or you can give it 
      //a view config. 
      view.push({ 
       title: 'Second', 
       html: 'Second view!' 
      }); 
     } 
    }] 
}] 

});

放掃描儀在第一項和掃描儀sencond視圖

或使用卡布局

放按鈕,在第二個項目 使用Ext.getCmp(cardlayoutid).animateActiveItem(Object/Number activeItem, Object/Ext.fx.layout.Card animation)在按鈕處理

+0

感謝你這麼多。 BRO – user998405