2013-09-26 95 views

回答

1

通過使用下面的代碼作爲你的 「/signaturefield/app/view/Signature.js」,就可以實現這一點:

Ext.define('myApp.view.Signature', { 
    extend: 'Ext.Container', 
    requires: [ 
     'Ext.form.Panel', 
     'Ext.form.FieldSet' 
    ], 
config: { 
     layout: 'card', 
     items: [{ 
      xtype: 'formpanel',   
      padding: '10 10 10 10', 
      items: [{ 
       xtype: 'fieldset', 
       hidden: true, 
       items: [{ 
        xtype: 'signaturefield', 
        id: 'signatureField', 
        sigWidth: 350, 
        sigHeight: 150, 
        label:'Enter Signature', 
        labelWidth: '20%' 
       }] 
      },{ 
       xtype: 'button', 
       text: 'Get Data', 
       margin:'0 0 10 0', 
       action: 'getSignature' 
      },{ 
       xtype: 'button', 
       text: 'Set Data', 
       action: 'setSignature' 
      }] 
     }] 
    }, 
    initialize: function() { 
     this.callParent(); 
     Ext.getCmp('signatureField').openCanvasSheet(); 
    } 
}); 

希望這會有所幫助:)