datagrid forms and pre-defined sorting sorting

Trevor DeVore lists at mangomultimedia.com
Wed Feb 2 21:05:22 EST 2011


On Wed, Feb 2, 2011 at 8:05 PM, Monte Goulding
<monte at sweattechnologies.com>wrote:

> Let's say I have a datagrid with dgData keys [firstname] and [lastname] and
> I always want to show the list sorted in alphabetical order so I need to
> sort by firstname then by lastname. Is the only way to do that:
>
> set the dgData of group "datagrid" to mydata
> SortDataByKey "firstname", "international", "ascending", false
> SortDataByKey "lastname", "international", "ascending", false
>

For data grid forms, yes this would be the only way. I never gave any
thought to this scenario as I've always had the data provider to the sorting
before displaying in the grid.


> Wouldn't this refresh the data grid 3 times?


Yes it would.


> It would be nice if there were a sort property of the datagrid so setting
> the dgData or changing the data in another way would automatically sort it
> before the first refresh. Or am I missing something Trev?
>

No, you aren't missing anything. There is already a 'sort by column'
property. I suppose a 'sort by key' synonym could be added and the sorting
logic could be applied to forms. I've added to a list of things to
investigate.

-- 
Trevor DeVore
Blue Mango Learning Systems
ScreenSteps: http://www.screensteps.com
LiveCode Resources for Developers: http://livecode.bluemangolearning.com



More information about the use-livecode mailing list