誰かが私にそれを宣言する方法を助けてくれるなら、私はextjs4.1コントローラーでグローバル変数を宣言できないといういくつかの問題に直面しています。私はここでそれを宣言する方法が私のコードです
Ext.define('Ext4Example.controller.poscontroller', {
extend: 'Ext.app.Controller',
//models: ['Vat','Rebate','Customer','Product','Invoice','Item','Order','Paymethod'],
stores: ['InvoiceIdFromSession','Vats','Rebates','Customers','Products','Invoices','Items','Paymethods'], //'Orders', ,'InvoiceIdFromSession','Products'
id : 'poscontroller',
views : ['stock.SaleWindow','stock.ItemForm2','stock.ItemsGrid','stock.CalculationForm'],
refs: [{
ref: 'itemForm',
selector: 'form'
}],
init: function() {
this.control({
'itemsgrid': {
removeitem: this.removeUser
},
'salewindow button[action=resetAll]': {
click: this.resertform
},
'salewindow button[action=saveOrder]' : {
click : this.onsaveOrder
},
'salewindow button[action=PDF]' : {
click : this. pdfreport
}
});
},
onsaveOrder : function(button){
// i want declare this variable to global variable
var itemform = Ext.getCmp('itemform2');
var calculation_Form =Ext.getCmp('calculation-form');
var ItemFrmdata = itemform.getForm().getValues();
var calcFrmdata = calculation_Form.getForm().getValues();
}