I am new to Ext, so I apologize in advance if my question is not clear enough / too basic ...
I have Ext.grid.EditorGridPanel with Ext.data.Store and Ext.data.JsonReader.
I have the following problem:
I would like to make the columns in my grid sortable, but the value returned from my store is not the value I would like to sort (the return value is an identifier, and I would like to sort this ID-card by line).
I have a rendering function that converts this identifier and string value, but I don't know how to integrate it into my code.
I found this post:
http://www.sencha.com/forum/showthread.php?45324-Grid-column-sorting-on-rendered-value
which looked like my need, but when I tried to add:
{name: 'my_field', sortType: my_render_function}
For my JsonReader, this did not work.
Where am I mistaken?
Thanks.
To request Pater:
var my_render = function(val, metaData, record, rowIndex, colIndex, store){ if (val == null) return ''; var n = another_store.getById(val); if (n == null) return ''; return n.data.name; }; var my_reader = new Ext.data.JsonReader({ root: 'my_root', id: 'tissue_num', }, [{ name: 'tissue_num', type: 'int' }, 'tissue_desc', 'organ'] ); var my_store = new Ext.data.Store({ url: request_url, baseParams: { _state: request_state, _action: 'get_conditions' }, sortInfo: { field: 'tissue_num', direction: "ASC" }, reader: my_reader, pruneModifiedRecords: true });