modified it some to be a little cleaner as well as allowing the data grid to know that it is sorting on the custom sorted column..

command sortDataGridColumn pColumn
  constant kColumnSize = "size"
  local tOldSortKey
  lock screen

  switch (pColumn)
    case kColumnSize
      lock messages
      put the dgProps["sort by column"] of me into tOldSortKey
      set the dgProps["sort by column"] of me to kColumnSize

if (the dgColumnSortDirection[kColumnSize] of me = "ascending") then set the dgColumnSortDirection[kColumnSize] of me to "descending"
      else
        set the dgColumnSortDirection[kColumnSize] of me to "ascending"
      end if
      unlock messages

sortDataByKey kColumnSize, "numeric", the dgColumnSortDirection [kColumnSize] of me, FALSE

set the dgHilite of group tOldSortKey of group "dgHeader" to FALSE
      set the dgHilite of group kColumnSize of group "dgHeader" to TRUE
      break
    default
      pass sortDataGridColumn
      break
  end switch
end sortDataGridColumn
_______________________________________________
use-revolution mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to