Note that there are some explanatory texts on larger screens.

plurals
  1. POSorting by the rendered value in an ExtJS 3 EditorGridPanel
    primarykey
    data
    text
    <p>I am new to Ext so I apologize in advance if my question is not clear enough/too basic...</p> <p>I have an Ext.grid.EditorGridPanel with an Ext.data.Store and an Ext.data.JsonReader.</p> <p>I have the following problem:</p> <p>I would like to make the columns in my grid sortable but the value returned from my store is not the value I'd like to sort by (the value returned is an ID and I'd like to sort by the string this ID maps to).</p> <p>I have a render function that converts between this ID and the string value but I don't know how to integrate this into my code.</p> <p>I have found this post:</p> <p><a href="http://www.sencha.com/forum/showthread.php?45324-Grid-column-sorting-on-rendered-value" rel="nofollow">http://www.sencha.com/forum/showthread.php?45324-Grid-column-sorting-on-rendered-value</a></p> <p>which looked similar to my need but when I tried adding:</p> <pre><code>{name: 'my_field', sortType: my_render_function} </code></pre> <p>to my JsonReader it did not work.</p> <p>Where do I get it wrong?</p> <p>Thanks.</p> <hr> <p>For Pater's request:</p> <pre><code>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 }); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload