Thanks Christain, I&#39;ve tried your tip but it doesn&#39;t work for me.<div>I don&#39;t know why but GeoExt persist to put my data in ascendent order by the &quot;date&quot; column, without ANY specification about that...I don&#39;t really understand.</div>
<div><br></div><div>Any other ideas???</div><div><br></div><div>Thanks to all<br><br><div class="gmail_quote">2011/11/4 Christian Mayer <span dir="ltr">&lt;<a href="mailto:mayer@terrestris.de">mayer@terrestris.de</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><u></u>

  
    
    
  
  <div bgcolor="#ffffff" text="#000000">
    Hi Riccardo,<br>
    <br>
    here a code snippet I have in use:<br>
     <br>
    <tt>myStore.setDefaultSort(&#39;magnitudo&#39;, &#39;DESC&#39;); // just after
      instanciating the store</tt><br>
    <br>
    Best regards,<br>
    Chris<br>
    <div>
      
      
      <div>
        <div><br>
        </div>
      </div>
    </div>
    <br>
    Am 02.11.2011 12:16, schrieb Riccardo Gaeta:
    <blockquote type="cite"><div><div></div><div class="h5">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 style="white-space:pre-wrap"> </span>styleMap:
          styleMap_sismi,</div>
        <div><span style="white-space:pre-wrap"> </span>strategies:
          [new OpenLayers.Strategy.Fixed()],</div>
        <div><span style="white-space:pre-wrap"> </span>protocol:
          new OpenLayers.Protocol.WFS({</div>
        <div><span style="white-space:pre-wrap"> </span>url:
          urlMS_sismi, version: &quot;1.1.0&quot;, featureType: &quot;sism_last15&quot;,</div>
        <div><span style="white-space:pre-wrap"> </span>featureNS:
          &quot;<a href="http://mapserver.gis.umn.edu/mapserver" target="_blank">http://mapserver.gis.umn.edu/mapserver</a>&quot;,</div>
        <div><span style="white-space:pre-wrap"> </span>extractAttributes:
          true, extractStyles: true, geometry: &quot;msGeometry&quot;, srsName:
          &quot;EPSG:32632&quot;</div>
        <div><span style="white-space:pre-wrap"> </span>})</div>
        <div><span style="white-space:pre-wrap"> </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 style="white-space:pre-wrap"> </span>//,
          paramOrder:[&#39;magnitudo&#39;] </div>
        <div><span style="white-space:pre-wrap"> </span>});</div>
        <div><span style="white-space:pre-wrap"> </span>//store_sismi.setDefaultSort(&#39;magnitudo&#39;,
          &#39;DESC&#39;);</div>
        <div><span style="white-space:pre-wrap"> </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 style="white-space:pre-wrap"> </span>columns:
          [<span style="white-space:pre-wrap"> </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 style="white-space:pre-wrap"> </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>
      </div></div><pre><fieldset></fieldset>
_______________________________________________
Users mailing list
<a href="mailto:Users@geoext.org" target="_blank">Users@geoext.org</a>
<a href="http://www.geoext.org/cgi-bin/mailman/listinfo/users" target="_blank">http://www.geoext.org/cgi-bin/mailman/listinfo/users</a>
</pre>
    </blockquote>
  </div>

<br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@geoext.org">Users@geoext.org</a><br>
<a href="http://www.geoext.org/cgi-bin/mailman/listinfo/users" target="_blank">http://www.geoext.org/cgi-bin/mailman/listinfo/users</a><br>
<br></blockquote></div><br></div>