View Full Version : Grid editor with 2 rows

21 Jun 2010, 12:20 AM
I would like to have EditorGridPanel.
If user select defined type in first column editor, than he must also select 4 other data, which editors would be shown in second row(and are reqired). If user change and selects other type in first column, than this 4 editors(data) would be gone and are not required any more.

So, I need editor grid panel with optional editable second row, dependable on what type user selects in first column editor. For some types the second row is visible and required to select data, and for other not.
(and the second row has different columns than the first row in my example the first row has 8 columns and the second only 4).

I think this is very common situation. Any idea how to solve this and any example?


21 Jun 2010, 12:36 AM
GridView doesn't support multiple editable rows by default.

You could use a RowExpander and put the extra 4 fields in the expanded section. However, these fields won't be part of the regular selection model and won't be tabable from the grid.

21 Jun 2010, 1:26 AM
Condor, thank you for your anwer.
So, they won't be part of selection model, but would be this extra fileds in rowExpander at least editable or how to make them editable when user click's on them? I guess It's good enough if only first(master) row is selectable.
Or any other better idea for this kind of problem? Some kind of master detail grid or something similar?

Thank you, Simon

21 Jun 2010, 1:41 AM
You would need to create extra code to make fields in the expander editable (register a click event that activates an Ext.Editor that will update the record when completed).

21 Jun 2010, 3:19 AM
Thank you for yours sugestions. I don't have time now, I'll try with 4 more columns in first row, sometimes populated sometimes not, depends on users choice in first column. When I found some time, I'll try your way.