Thursday, 12 September 2013

ExtJS: consolidating records in store

ExtJS: consolidating records in store

Considering a simple example, consider the following store of records:
{ item: 'A', group: 'red', quantity: 1 },
{ item: 'A', group: 'green', quantity: 1 },
{ item: 'B', group: 'red', quantity: 1 },
{ item: 'B', group: 'blue', quantity: 1 },
{ item: 'C', group: 'green', quantity: 1 }
My goal is to have a grid with each distinct group field as a filter,
where all active filters consolidate. Examples:
// show: red, green // show: green // show: red, blue
item | quantity item | quantity item | quantity
--------------- --------------- ---------------
A | 2 A | 1 A | 1
B | 1 C | 1 B | 2
C | 1
Is there a built-in way to handle this? My thoughts were to first apply a
filter on group, then use a collector, then a special renderer.
Thoughts?

No comments:

Post a Comment