P4G0
13 Apr 2012, 1:01 AM
Hey guys,
I want to pass parameters from the view's sourcecode to my store's proxy without using the init function or something like that. This is my view:
Ext.define('App.view.QSPanel', {
extend: 'Ext.tab.Panel',
items: [{
title: 'Basic',
xtype: 'ParameterDiffTable',
store: Ext.create('App.store.QAParameters')
}, {
title: 'Another Tab',
xtype: 'ParameterDiffTable',
store: Ext.create('App.store.QAParameters')
}]
});
And that is my store:
Ext.define('App.store.QAParameters', {
extend : 'Ext.data.Store',
model : 'App.model.QAParameter',
autoLoad : true,
proxy : {
type : 'ajax',
url : BASE_URL + '/getParameters.json',
reader : {
type : 'json'
},
extraParams : {
section : 'basic'
}
}
});
Now I want to display different data depending on the selected tab. Currently I have hardcoded the section 'basic' to my store's proxy (for testing purposes → works), but that should be dynamic. I wonder if it's possible, to pass that parameter like this:
Ext.create('App.store.QAParameters', section: 'xyz');
Any suggestions?
I want to pass parameters from the view's sourcecode to my store's proxy without using the init function or something like that. This is my view:
Ext.define('App.view.QSPanel', {
extend: 'Ext.tab.Panel',
items: [{
title: 'Basic',
xtype: 'ParameterDiffTable',
store: Ext.create('App.store.QAParameters')
}, {
title: 'Another Tab',
xtype: 'ParameterDiffTable',
store: Ext.create('App.store.QAParameters')
}]
});
And that is my store:
Ext.define('App.store.QAParameters', {
extend : 'Ext.data.Store',
model : 'App.model.QAParameter',
autoLoad : true,
proxy : {
type : 'ajax',
url : BASE_URL + '/getParameters.json',
reader : {
type : 'json'
},
extraParams : {
section : 'basic'
}
}
});
Now I want to display different data depending on the selected tab. Currently I have hardcoded the section 'basic' to my store's proxy (for testing purposes → works), but that should be dynamic. I wonder if it's possible, to pass that parameter like this:
Ext.create('App.store.QAParameters', section: 'xyz');
Any suggestions?