PDA

View Full Version : Grid Column Sorting Question



awhiteho
10 Dec 2012, 4:52 AM
I've got an app where I'm loading data into a grid in a certain sort sequence based on different search fields the user can specify. This is done using the Order By on the sql when retrieving the data from the Db.

Once the data is loaded into the grid the user can re-sort the data by clicking on a column header.

My problem is this, if the user performs another search I want the sort to revert back to the sort sequence before they clicked on a grid column.

I assumed the headerCt.clearOtherSortStates(null , true); would do what I was looking for. This does clear graphic arrow on the column header that was clicked but when the grid's reloaded it still retains the sort sequence of the clicked column.

Any help would be appreciated

mitchellsimoens
12 Dec 2012, 8:05 AM
You need to clear the sorting on the store, the grid reflects the sorting on the store

awhiteho
12 Dec 2012, 9:23 AM
Hi Mitchell,

This is probably a stupid question but not sure how to clear the sorting on the store.

Within the store definition I don't specify any sort fields, the sql order by is controller the sequence of the data initially coming in.

I looked thru all the methods for a store & wasn't sure which 1 would clear the sorting.

Thanks

awhiteho
13 Dec 2012, 5:10 AM
Looks like I was over complicating things. All I had to do was add sortOnLoad : false in the store definition.

Thanks