PDA

View Full Version : Design question: Two data types in one grid-like control with row expansion



ESarge
16 Feb 2010, 6:09 AM
Hi,
With ExtJS what controls/plugins would you use for the following idea? I don't know whether to try with a Grid and the RowExpander plugin or roll it myself using panels.

I have data which returns two data types in sequence. I have segments, which have name and distance, and crossings where segments cross. Crossings have a description and the name and segment of the segments they cross. The data has a sequence of crossing, segment, crossing, segment, crossing, etc.

What I'd like to do is to show the data in a grid-like control. What's displayed on each row differs depending on the data type and the row can be expanded to drop-down and show more information - also depending on the data type.

Some rough ascii art of what I'm thinking.

Collapsed:
| Name | Distance | Description
C | Richmond parking lot |
S | Richmond Rd | 2.5km | Long and flat |
C | Movie theatre |

Expanded:
| Name | Distance | Description
C | Richmond parking lot |
Description: Parking lot by restaurant.
Crosses: Auckland Rd Segment 1
Crosses: Auckland Rd Segment 2
S | Richmond Rd | 2.5km | Long and flat |
Matches: Richmond Rd
C | Movie theatre |

Many thanks for any advice you have.

Thanks,
Edward