sorting a column in a dataGrid by dateTime

FORD JR., CURT CFORD at mailbox.sc.edu
Tue Dec 10 16:03:19 EST 2013


Thanks, Richard & Alex - sometimes I get stuck because I don't expect how simple LiveCode can make something. So experimenting with a field, this works fine:


on mouseUp

   put fld "source" into tSource

   sort tSource dateTime

   put tSource into fld "result"

end mouseUp

Now - is there a way to adapt that for a data grid?

Looking at http://lessons.runrev.com/s/lessons/m/datagrid/l/7330-how-do-i-customize-column-sorting  I tried putting this in the script for the data grid:


on SortDataGridColumn pColumn



   switch pColumn

      case "Time"

         sort pColumn dateTime

         break



      default

         pass SortDataGridColumn



   end switch



end SortDataGridColumn


..but nothing seems to change - is there a step I'm missing? Does the column need to get reloaded somehow?


The lines in the column have the abbrev date concatenated with the long time, for example: Wed, Nov 13, 2013 8:19:15 PM


Thanks again for any help -


Curt



More information about the Use-livecode mailing list