Hybrid View
-
20 Feb 2009 4:18 AM #1
Grids, checkbox and combo
Grids, checkbox and combo
Hello!
I've got some problems with my app.
1. I've got a combo as a field of one of my grids:
It works as i want, but when i select one of the results and i blur my combo, it shows the id...
There is the code:
Code:{ header: "Empleado", width: 200, sortable: true, dataIndex: 'Empleado', editor: new Ext.grid.GridEditor(new Ext.form.ComboBox({ store: new Ext.data.JsonStore({ url: '../contratos/gestionEmpleados.php', root: 'filas', baseParams: parametros, fields: ['id', 'nombre'], totalProperty: "results" }), displayField:'nombre', typeAhead: true, valueField: 'id', mode: 'remote', hideTrigger: true, minChars: 1, maxChars: 9, forceSelection: true, triggerAction: 'all', selectOnFocus:true }) ) }
2. I've got 2 grids from the same controller (an own controller). If i comment one of them, the other one works fine, but when i use both, it just works the second one. When i select an item from the first grid, it selects the second one.
Do you know why is it? i tried to render my grids in different panels but it didn't work...
Thanks a lot!
-
20 Feb 2009 4:24 AM #2
1. you need to use a renderer. I think there was a feature request to make that a little easier, it was posted in last 3 months or so. It was just a request, I don't recall if sample code was posted. Short answer is use a renderer. You may also want to check the hiddenName config if you plan to submit to backend.
2. smells like you've re-used an id or store. You didn't post any code, so who knows?MJ
API Search || Ext 3: docs-demo-upgrade guide || User Extension Repository
Frequently Asked Questions: FAQs
Tutorial: Grid (php/mysql/json) , Application Design and Structure || Extensions: MetaGrid, MessageWindow
-
20 Feb 2009 4:36 AM #3
Thanks for your fast response!!!
Ok! I'll try to use renderer...
Those are my grids:
I forgot checkbox topic! Basicly, the problem is it isn't shown the checkboxes, it shows just when i select the item...Code:gridObservaciones = new grid_1xN({ tabla: 'obsoferta', id_PK1: 'Oferta', id_PKN: 'IDobsoferta', valorId_PK1: idOferta, columnasRelacion: [{ header: "Fecha", width: 120, sortable: true, dataIndex: 'Fecha', editor: new Ext.form.DateField({ allowBlank: false, allowNegative: false, allowDecimals:false }) },{ header: "Empleado", width: 200, sortable: true, dataIndex: 'Empleado', editor: new Ext.grid.GridEditor(new Ext.form.ComboBox({ store: new Ext.data.JsonStore({ url: '../contratos/gestionEmpleados.php', root: 'filas', baseParams: parametros, fields: ['id', 'nombre'], totalProperty: "results" }), displayField:'nombre', typeAhead: true, valueField: 'id', mode: 'remote', hideTrigger: true, minChars: 1, maxChars: 9, forceSelection: true, triggerAction: 'all', selectOnFocus:true }) ) },{ header: "Comentario", width: 350, sortable: true, dataIndex: 'comentario', editor: new Ext.form.TextField({ allowBlank: false }) }] }); //Grid de Subsanaciones gridSubsanaciones = new grid_1xN({ tabla: 'subsanaciones', id_PK1: 'idOferta', id_PKN: 'idSubsanacion', valorId_PK1: idOferta, columnasRelacion: [{ header: "fecha notificacion", width: 100, sortable: true, dataIndex: 'fechaNotificacion', editor: new Ext.form.DateField({ allowBlank: false }) },{ header: "Deficiencias", width: 400, sortable: true, dataIndex: 'deficiencias', editor: new Ext.form.TextField({ allowBlank: false }) },{ header: "Fecha otorgada", width: 100, sortable: true, dataIndex: 'fechaOtorgada', editor: new Ext.form.DateField({ allowBlank: false }) },{ header: "¿Subsanado?", width: 80, sortable: true, dataIndex: 'subsanado', editor: new Ext.form.Checkbox() }] });

Thanks!
-
20 Feb 2009 5:20 AM #4
Am I supposed to know what grid_1xN is?
MJ
API Search || Ext 3: docs-demo-upgrade guide || User Extension Repository
Frequently Asked Questions: FAQs
Tutorial: Grid (php/mysql/json) , Application Design and Structure || Extensions: MetaGrid, MessageWindow
-
20 Feb 2009 5:33 AM #5
grid_1xN is coded by my own. It's a generic generator of grids with 1xN relation...
I think the problem is with my controller, because i reference it with "this". I think second grid is always "this" and i can't reference to the first one becouse of it... could it be that?
Thanks!
-
20 Feb 2009 5:43 AM #6
I don't know what your grid class is, I don't know what your controller is.
http://extjs.com/learn/Ext_Forum_HelpMJ
API Search || Ext 3: docs-demo-upgrade guide || User Extension Repository
Frequently Asked Questions: FAQs
Tutorial: Grid (php/mysql/json) , Application Design and Structure || Extensions: MetaGrid, MessageWindow


Reply With Quote