Topic
  • 1 reply
  • Latest Post - ‏2013-01-18T14:30:25Z by SystemAdmin
SystemAdmin
SystemAdmin
6195 Posts

Pinned topic How to reset sort in datagrid

‏2013-01-16T09:08:39Z |
I have a datagrid widget that I am populating based on a database extract. Using the inherent capabilities of the widget, I sort a column by selecting it. I now want to be able to undo the sort (ie set the data back to how it was originally displayed (where I populate the data by sorting on three keys). If I reload the data from the database, it stays in the same sort, thus my only current solution is to reload the page which isn't the cleanest solution. I imagine that there is some option within the datagrid that I can set to reset the sort, but I can't find anything. Without writing a ton of custom code, does anyone know of a solution for this?
Updated on 2013-01-18T14:30:25Z at 2013-01-18T14:30:25Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    6195 Posts

    Re: How to reset sort in datagrid

    ‏2013-01-18T14:30:25Z  
    Thank you Ji Yong for the code snipet:

    for(i int from 1 to DataGrid.columns.getSize())
    DataGrid.columns[i].sortDirection = DataGridLib.SORT_NONE;
    end