我遇到了一些问题,如果有人可以帮助我,我无法在 extjs 4.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();
}