I am trying to set up a button to sort the lines of a datagrid. The following is part of the script:
put orgchoice&"data" into thegroup ## orgchoice is a global variable, previously assigned
put orgchoice & " chq list" into thecard
put the dgtext of group thegroup of card thecard into dataset
sort lines of dataset numeric by word 1 of each
set the dgtext of group thegroup of card thecard to dataset
When I work with this in the message box, putting line 1 of dataset returns the correct line, but the datagrid is not being changed, ie the line I test is not the same as the line from dataset. Have I messed up the syntax somewhere?
Thanks, Dave
Sorting a datagrid
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 977
- Joined: Sat Apr 08, 2006 7:47 am
- Contact:
Re: Sorting a datagrid
Take a look at the examples I put together on my blog for one way of handling sorting in a datagrid:
HTH,
Jan Schenkel.
Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com
www.quartam.com
Re: Sorting a datagrid
Thanks, Jan. I copied your script and pasted it into the datagrid script. However, clicking on a column header does not change the order of the lines, before or after refreshing. Perhaps there are some modifications I need to make, but am too much of an amateur to recognize. If nothing else, your comments before the script told me about sorting directly which worked for my datagrid. Of course, that's not available in the standalone.
Dave
Dave
Re: Sorting a datagrid
Looks like I posted too soon. It does appear to be working, however the heading for the first column has disappeared, and that's the column I want to sort by under non-testing conditions.
Dave
Dave