Esto se usa con Extjs. Éste es el código del Store:
Código:
Éste es el código del Form:var cuentaStore = Ext.create('Ext.data.Store', { model : 'catCuentaModel', proxy : { type : 'ajax', url : '../action/cuentas', method : 'GET', pageParam: false, startParam: false, limitParam: false, noCache: false, reader : { type : 'json', root : 'claveCuenta' }, extraParams : { 'tCta' : '' } } });
Código:
MyForm = Ext.create('Ext.form.Panel', { title: 'Reporte de Cuentas', margin:'5 0 0 300', renderTo: 'repcueayb', url: urlReporte, bodyStyle: 'padding:5px 5px 0', //layout: 'vbox', frame: true, width: 600, //600 height: 230, //layout: 'border', standardSubmit: true, items: [Txt_FechaIni, Txt_FechaFin, { xtype: 'radiogroup', id: 'tipoCta', fieldLabel: 'Tipo de cuenta', width: 300, items: [ {boxLabel: 'A', name: 'tCta', inputValue: 0, checked: true}, {boxLabel: 'B', name: 'tCta', inputValue: 1} ], listeners: { scope: this, 'checked': function() { cuentaStore.getProxy().extraParams = { tCta: Ext.getCmp('tipoCta') }; cuentaStore.load({ params : { tCta: Ext.getCmp('tipoCta') } }); } } }, { id : 'cuenta', name : 'cuenta', xtype : 'combobox', fieldLabel : 'Cuenta', emptyText : '-Seleccionar-', store : cuentaStore, displayField : 'cuenta', valueField : 'cuenta', editable : false, forceSelection : true, triggerAction : 'all', allowBlank : false, blankText : 'Debe seleccionar unna cuenta.' } , { xtype: 'radiogroup', id: 'formato', fieldLabel: 'Formato', items: [ {boxLabel: 'Excel', name: 'fmtoval', inputValue: 1, checked: true}, {boxLabel: 'PDF', name: 'fmtoval', inputValue: 2}, {boxLabel: 'CSV', name: 'fmtoval', inputValue: 3} ] }], buttons: [btn, btn2] });
Pero al momento de dar clic al comboBox no me regresa nada ya que no le paso en ningun momento el parametro tCta.