alessio77
11 Apr 2012, 2:46 AM
Ext.get('ddlCustomer').getValue() does't work in this context, why?
what i'm wrong?
Ext.define('App.controller.ArchiveManager', {
extend: 'Ext.app.Controller',
stores: ['Customer', 'CustomerDocumentType', 'UserColumnsArchive', 'DbFieldType', 'LookUpTable'],
models: ['Customer', 'CustomerDocumentType', 'ColumnArchive', 'UserColumnsArchive', 'DbFieldType', 'LookUpTable'],
views: ['manager.ArchiveManager'],
init: function () {
this.getCustomerStore().load(); //load the combo that i'm interested in
...
.....code
........code
............code
.....................
//register an event for a store where i'll use the combovalue to filter the query
this.getLookUpTableStore().addListener('beforeload', this.LookUpTableStore_beforeload, this)
},
//this event will fire after the combo was loaded and by an user action
LookUpTableStore_beforeload: function (store, operation, eOpts) {
var customerID = Ext.get('ddlCustomer').getValue(); //<---here the value is undefined even if in this moment the combo is correctly loaded
operation.params = { id: customerId };
}
});
the combobox id is: ddlCustomer
the combobox xtype is: combo
are there other different ways to get a reference to the combobox value inside the controller?
for example getting reference to the linked combo store instead of the combo
what is the "better" way to follow?
anyway why the value is undefined??
what i'm wrong?
Ext.define('App.controller.ArchiveManager', {
extend: 'Ext.app.Controller',
stores: ['Customer', 'CustomerDocumentType', 'UserColumnsArchive', 'DbFieldType', 'LookUpTable'],
models: ['Customer', 'CustomerDocumentType', 'ColumnArchive', 'UserColumnsArchive', 'DbFieldType', 'LookUpTable'],
views: ['manager.ArchiveManager'],
init: function () {
this.getCustomerStore().load(); //load the combo that i'm interested in
...
.....code
........code
............code
.....................
//register an event for a store where i'll use the combovalue to filter the query
this.getLookUpTableStore().addListener('beforeload', this.LookUpTableStore_beforeload, this)
},
//this event will fire after the combo was loaded and by an user action
LookUpTableStore_beforeload: function (store, operation, eOpts) {
var customerID = Ext.get('ddlCustomer').getValue(); //<---here the value is undefined even if in this moment the combo is correctly loaded
operation.params = { id: customerId };
}
});
the combobox id is: ddlCustomer
the combobox xtype is: combo
are there other different ways to get a reference to the combobox value inside the controller?
for example getting reference to the linked combo store instead of the combo
what is the "better" way to follow?
anyway why the value is undefined??