2012-12-21 50 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