[Dojo-interest] Case insensitive sorting for grids?

dave.alvarado at remanresource.com dave.alvarado at remanresource.com
Fri Jan 9 17:23:41 UTC 2009


Ah, I didn't realize you are one of the fathers of Dojo.  Thanks for this explanation.  I may override the default sorter but the method that you first described works great.

 - Dave


>  -------Original Message-------
>  From: Jared Jurkiewicz <jared.jurkiewicz at gmail.com>
>  Subject: Re: [Dojo-interest] Case insensitive sorting for grids?
>  Sent: Jan 09 '09 17:14
>  
>  I show.   I wrote that page.  ;)
>  
>  You have to do each explicitly unless you want to over-ride the
>  utility function:
>  
>  dojo.data.util.sorter.basicComparator
>  
>  Defined in:
>  
>  dojo/data/util/sorter.js
>  
>  -- Jared
>  
>  
>  On Thu, Jan 8, 2009 at 4:56 PM,  <dave.alvarado at remanresource.com> wrote:
>  > In the link you sent, they show how to define a custom sort function for a particular column.  Is there a way to apply that function to all columns or do I have to go through and list each explicitly?
>  >
>  >  - Dave
>  >
>  >
>  >>  -------Original Message-------
>  >>  From: Jared Jurkiewicz <jared.jurkiewicz at gmail.com>
>  >>  Subject: Re: [Dojo-interest] Case insensitive sorting for grids?
>  >>  Sent: Jan 08 '09 19:39
>  >>
>  >>  Implement a custom sort function for ItemFile*Store that does it for
>  >>  the columns you're interested in being case insensitive:
>  >>
>  >>  See docs:
>  >>  http://docs.dojocampus.org/dojo/data/ItemFileReadStore#custom-sorting
>  >>
>  >>  -- Jared
>  >>
>  >>
>  >>
>  >>  On Thu, Jan 8, 2009 at 1:57 PM,  <dave.alvarado at remanresource.com> wrote:
>  >>  > Hi,
>  >>  >
>  >>  > I'm using Dojo 1.2.  I have created a grid based off an ItemFileWriteStore.  When I click on a column header, my grid gets sorted either by ascending or descending order, depending on the arrow in the column header ...
>  >>  >
>  >>  > http://screencast.com/t/iDDGvIfIV
>  >>  >
>  >>  > Here is the code I use to set up my grid data ...
>  >>  >
>  >>  >                        var featuresView = {
>  >>  >                                cells: [
>  >>  >                                        [{name: 'Name', field: 'name',width: '25%'},
>  >>  >                                        {name: 'Description', field: 'description',width: '50%'},
>  >>  >                                        {name: 'Load BLS Data', field: 'load', width: '25%'}
>  >>  >                                        ]
>  >>  >                                ]
>  >>  >                        };
>  >>  >                        var featuresLayout = [ featuresView ];
>  >>  >                        var featuresGridColumns = [{id:"name",label:"Name"},
>  >>  >                                {id:"description",label:"Description"}
>  >>  >                        ];
>  >>  >                        var featureData = [ ... ];
>  >>  >                        var featuresGridModel = { items: featureData };
>  >>  >                        var featuresGridStore = new dojo.data.ItemFileWriteStore({data:featuresGridModel});
>  >>  >                        var featuresModel = new dojox.grid.data.DojoData(null,featuresGridStore);
>  >>  >
>  >>  > My question is, how can I make column sorting a case insensitive operation?
>  >>  >
>  >>  > Thanks, - Dave
>  >>  > _______________________________________________
>  >>  > FAQ: http://dojotoolkit.org/support/faq
>  >>  > Book: http://dojotoolkit.org/docs/book
>  >>  > Forums: http://dojotoolkit.org/forum
>  >>  > Dojo-interest at dojotoolkit.org
>  >>  > http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest
>  >>  >
>  >>  _______________________________________________
>  >>  FAQ: http://dojotoolkit.org/support/faq
>  >>  Book: http://dojotoolkit.org/docs/book
>  >>  Forums: http://dojotoolkit.org/forum
>  >>  Dojo-interest at dojotoolkit.org
>  >>  http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest
>  >>
>  > _______________________________________________
>  > FAQ: http://dojotoolkit.org/support/faq
>  > Book: http://dojotoolkit.org/docs/book
>  > Forums: http://dojotoolkit.org/forum
>  > Dojo-interest at dojotoolkit.org
>  > http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest
>  >
>  _______________________________________________
>  FAQ: http://dojotoolkit.org/support/faq
>  Book: http://dojotoolkit.org/docs/book
>  Forums: http://dojotoolkit.org/forum
>  Dojo-interest at dojotoolkit.org
>  http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest
>  


More information about the Dojo-interest mailing list