En ExtJS, quiero configurar extraParam en un controlador. Estos extraParams deben usarse en una tienda.
Quiero mostrar datos en mi cuadro combinado en función de una condición.
Si se cumple la condición 1, el parámetro adicional contiene abc.1
Luego, la tienda carga los datos correspondientes a un ID de grupo para obtener datos
..lo mismo para la condición 2(abc.2).
¿Cómo puedo configurar extraparam?
//Tienda
abcStore: { type: 'store', proxy: { type: 'ajax', url: PPA_SERVICE_BASE_URL + 'any.Service', paramsAsJson: true, actionMethods: { read: 'POST' }, reader: { type: 'json', rootProperty: 'data' }, } }//Caja combo
xtype: 'combobox', fieldLabel: 'Payment Stream Type', labelWidth: 130, width: 280, editable: false, margin: '0 10 0 0', displayField: 'label', allowBlank: false, bind: { store: '{abcStore}', }//Controlador - funcion para cargar datos
loadabcData: function(newValue) { var me = this, view = me.getView(), viewModel = this.getViewModel(), store = viewModel.getStore('abcStore'), extraParam = {groupId: groupId}; store.getProxy().setExtraParams(extraParams); store.load(); // How should i further set this groupID.I want to set groupId value as abc.1 on condition1 and //abc.2 on condition 2 },casi lo tienes
loadabcData: function(condition) { var me = this, view = me.getView(), viewModel = this.getViewModel(), store = viewModel.getStore('abcStore'), // ==> next line does the trick groupId = (condition === 'Cond1') ? 'abc.1' : 'abc.2', extraParam = {groupId: groupId}; store.getProxy().setExtraParams(extraParams); store.load(); // How should i further set this groupID.I want to set groupId value as abc.1 on condition1 and //abc.2 on condition 2 },