PDA

View Full Version : Sort grid on displayed (rendered) value?



tomhoag
10 May 2010, 10:56 AM
I have a grid with a column that is rendered to a string from an integer in the underlying store.

I'd like the column sort to sort by the rendered string and not the underlying integer.

Any pointers on how to go about this?

thanks

tom

Animal
10 May 2010, 1:37 PM
http://www.extjs.com/deploy/dev/docs/?class=Ext.data.Field&member=sortType

tomhoag
11 May 2010, 5:46 AM
Thanks for the pointer Animal.

If I understand the doc correctly, the function should return the item's position in the sort order?

Thanks again

tom

Condor
11 May 2010, 5:54 AM
No, it should just return a sortable value.

If you have a simple 1-argument renderer then you could use the same function as sortType.

tomhoag
11 May 2010, 7:27 AM
Excellent! Thanks