0
votes

I have a grid backed by a grouping store in which I have a column that I use a custom renderer.

In that custom renderer, I break apart the value in the column and use it to construct a panel in the cell.

I want to have the group action group by only one part of the value I pass to the cell, ie:

to this one column, I pass a string like this:

a|2|somestring
a|3|someotherstring
b|1|thirdstring

which I want to be grouped as:

a|2|somestring
a|3|someotherstring

b|1|thirdstring

but default grid behavior is to group as:

a|2|somestring

a|3|someotherstring

b|1|thirdstring

as they're all unique strings.

To do this, It'd be awesome if there were a function I could override for that cell that would let me retrieve the string for comparison.

Is this possible?

2

2 Answers

1
votes

Without your code it's a little difficult to do for scenario, but basically you can bring back the data you want to group on, and load it into your store (just don't show it in your grid's column model).

You can then declare that as your groupField in your store config.

In your GroupingView for the grid you can then display the concatenated string. Should be something like...

Grid config:

//...
groupField: 'singleLetterField'
//...

GroupingView config:

//...
groupTextTpl: '{nameOfConcatenatedStringInStore}'
//...

If this doesn't fit your scenario, show me your code and I'll tweak it

0
votes

Ext.grid.Column#groupRenderer is the function used to define what the column is grouped by. I can process the string stored in the column and return what I want the column grouped into.

Thanks to Jaitsu for getting me looking in the right place.