0
votes

I have a grid in Extjs and I want to add rowExpander on a condition, The condition is:

If there is more than one record with same ID in store, then only one record will be visible in grid, but a rowExpander(plus icon) will be added with the record, And when we click on plus icon it will show all the remaining records of ID.

I want a grid like this:


|     | ID | NAME | FIELD1 | FIELD2 | FIELD3 | FIELD4 | FIELD5 |


|  +  | 01 | ABCD | TEST01 | TEST02 | TEST03 | TEST04 | TEST05 |


|     | 02 | ABCD | TEST01 | TEST02 | TEST03 | TEST04 | TEST05 |


|     | 03 | ABCD | TEST01 | TEST02 | TEST03 | TEST04 | TEST05 |


|     | 04 | ABCD | TEST01 | TEST02 | TEST03 | TEST04 | TEST05 |

|     | 04 | ABCD | TEST01 | TEST02 | TEST03 | TEST04 | TEST05 |

|  -  | 04 | ABCD | TEST01 | TEST02 | TEST03 | TEST04 | TEST05 |

|     | 04 | ABCD | TEST01 | TEST02 | TEST03 | TEST04 | TEST05 |

|     | 04 | ABCD | TEST01 | TEST02 | TEST03 | TEST04 | TEST05 |


Please suggest a solution for this.

Thanks :)

1
Do you want just show those rows, or edit them too?Nikolai Lopin
I want to edit them tooGoalDone

1 Answers

1
votes

I made some research about this problem this year.

As I understand the framework, it's impossible to have a nested grid in grid component. Using some hacks, you can only create a read-only subgrid inside rowExpander plugin. (actually, you can create components inside, but you won't catch any events from them)

In your case you can try to use grouping feature to group records in your store.

I've also seen another implementation — show window with a subgrid after click on main grid row.

Hope this information will help you.