Specifying a Default Sort for Dojo Datagrids

Posted in Inside TFG

I spent five minutes finding this today (don’t get me started on Dojo documentation!) so I thought I’d try and put it in an easier to find place – Google.

I wanted to specify my sort order declaratively as part of the tag defining my Datagrid and this is what I found to work :


table dojoType="dojox.grid.DataGrid" store="store" sortInfo="-4"

This will tell the datagrid to automatically sort the Datagrid in a descending manner on column 4. If I’d used 5, or “+5″ then that would be in ascending sort order on the fifth column.

1 Comment

  • Sagar

    Oct 14, 2011

    Thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Twitter

The latest @rubyfive podcast is up, our own @sj26 receiving a mention for Ruby 1.9.3 performance improvements. http://t.co/hfx3EPMz

@frontiergroup about 6 days ago #

Search Posts

Featured Posts

Categories

Archives

View more archives