Hi all,<div>I have a problem: I&#39;m not able to set correctly the sortInfo to have my data ordered in my GridPanel by a column.</div><div>I&#39;ve spent lot of time by forum but I was not able to find a solution for me.</div>
<div>I load a WFS layer from MapServer/Postgis, then I like order the data (like 20-30 records) by date field.</div><div>My date field originally come from Postgres &quot;timestamp&quot;, but here I translate it as string.</div>
<div>Anyway I don&#39;t know why Ext order my records with this column &quot;full_date&quot;, in ascending order, and I&#39;m not able to reverse this order, or better change the field to use for order my data (like &quot;magnitudo&quot;, that is a double field).</div>
<div><br></div><div>I use Ext 3.4.0, and I try my page on Chrome.</div><div><br></div><div>Thanks everyone could give me a suggest!!!</div><div><br></div><div>The code (the commented line are my test:they don&#39;t work):</div>
<div><br></div><div><div>var sismi = new OpenLayers.Layer.Vector(&quot;Sismicitā strumentale - ultimi 15 giorni&quot;, {</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>styleMap: styleMap_sismi,</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>strategies: [new OpenLayers.Strategy.Fixed()],</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>protocol: new OpenLayers.Protocol.WFS({</div>
<div><span class="Apple-tab-span" style="white-space:pre">                        </span>url: urlMS_sismi, version: &quot;1.1.0&quot;, featureType: &quot;sism_last15&quot;,</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>featureNS: &quot;<a href="http://mapserver.gis.umn.edu/mapserver">http://mapserver.gis.umn.edu/mapserver</a>&quot;,</div>
<div><span class="Apple-tab-span" style="white-space:pre">                        </span>extractAttributes: true, extractStyles: true, geometry: &quot;msGeometry&quot;, srsName: &quot;EPSG:32632&quot;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>})</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>});</div><div>var store_sismi = new GeoExt.data.FeatureStore({</div><div>        fields: [</div><div>            {name: &quot;latitudine&quot;, type: &quot;float&quot;},</div>
<div>            {name: &quot;longitudine&quot;, type: &quot;float&quot;},</div><div>            {name: &quot;profondita&quot;, type: &quot;float&quot;},</div><div>            {name: &quot;magnitudo&quot;, type: &quot;float&quot;, mapping:&quot;magnitudo&quot;},</div>
<div>            {name: &quot;regione_geografica&quot;, type: &quot;string&quot;},</div><div>            {name: &quot;num_fasi&quot;, type: &quot;integer&quot;},</div><div>            {name: &quot;max_gap_az&quot;, type: &quot;integer&quot;},</div>
<div>            {name: &quot;localita&quot;, type: &quot;string&quot;},</div><div>            {name: &quot;full_date&quot;, type: &quot;string&quot;}</div><div>        ],</div><div>        layer: sismi</div><div>        //, remoteSort: false //to enable sorting from server</div>
<div>        , sortInfo:{&quot;field&quot;: &#39;magnitudo&#39;, &quot;direction&quot;: &quot;DESC&quot;} //don&#39;t work...</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>//, paramOrder:[&#39;magnitudo&#39;] </div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>});</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>//store_sismi.setDefaultSort(&#39;magnitudo&#39;, &#39;DESC&#39;);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>//store_sismi.sort(&#39;magnitudo&#39;, &quot;DESC&quot;);</div>
</div><div><br></div><div><div>gridPanel = new Ext.grid.GridPanel({</div><div>                xtype : &#39;grid&#39;, //a cosa serve?</div><div>                title: &quot;Elenco degli eventi sismici&quot;,</div><div>                region: &quot;south&quot;,</div>
<div>                //stripeRows: true,</div><div>                columnLines: true,</div><div>                viewConfig: {forceFit: true},</div><div>                store: store_sismi,</div><div>                loadMask: true, //a cosa serve?</div>
<div>                height: Math.round(height_map*0.4), //280</div><div>                autoScroll: true,</div><div>                collapsible: true,</div><div>                collapsed: false,</div><div>                //sm: new GeoExt.grid.FeatureSelectionModel(), //per sincronizzare grid e features</div>
<div>                cm: new Ext.grid.ColumnModel({</div><div>                    defaults: {</div><div>                        sortable: true</div><div>                    },</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>columns: [<span class="Apple-tab-span" style="white-space:pre">                                                </span></div>
<div>                        {header: &quot;&lt;b&gt;Magnitudo [ML]&lt;/b&gt;&quot;, dataIndex: &quot;magnitudo&quot;, decimalPrecision: 2,</div><div>                        align: &quot;center&quot;, width: 150},</div><div>
<span class="Apple-tab-span" style="white-space:pre">                        </span>{header: &quot;&lt;b&gt;Tempo origine&lt;/b&gt;&quot;, dataIndex: &quot;full_date&quot;, width: 175},</div><div>                        {header: &quot;Prof. [km]&quot;, dataIndex: &quot;profondita&quot;, decimalPrecision: 2, align: &quot;center&quot;},</div>
<div>                        {header: &quot;Lat&quot;, dataIndex: &quot;latitudine&quot;, decimalPrecision: 3, align: &quot;center&quot;},</div><div>                        {header: &quot;Lon&quot;, dataIndex: &quot;longitudine&quot;, decimalPrecision: 3, align: &quot;center&quot;},</div>
<div>                        {header: &quot;Regione geografica&quot;, dataIndex: &quot;regione_geografica&quot;, width: 180},</div><div>                        {header: &quot;Localita&quot;, dataIndex: &quot;localita&quot;, width: 180},</div>
<div>                        {header: &quot;Nfasi&quot;, dataIndex: &quot;num_fasi&quot;, align: &quot;center&quot;},</div><div>                        {header: &quot;gap&quot;, dataIndex: &quot;max_gap_az&quot;, align: &quot;center&quot;}</div>
<div>                ]</div><div>        })</div><div>        //,autoLoad: true //se true anche se il layer non č sulla mappa viene caricato</div><div>    });</div></div>