PDA

View Full Version : Remove Sort only from a stateful extjs grid



jkozer26
19 Jan 2011, 10:03 AM
I am not sure if this would be a new feature request/have a workaround/or impossible to do. I have a stateful extjs grid (with the stateful property set to true). It has the ability to sort and move column positions.

I am running into an issue with clearing the sort order that I am running into. One of these grids has an order specific to a hidden column. If the user wishes to sort a "shown" column then it is next to impossible to clear just the "sort" child object of this stateful grid. I know that Ext.state.Manager has a clear property which will allow you to remove a value from the state manager. However, I have to clear the whole thing by using this - both sort and column children objects of this stateful grid with this method.

I have also tried brute force setting the state manager to a javascript object and removing just the sort and leaving the column order but this causes more issues and disables the sort permanently.

My question is there a work around to just remove the sort instead of the whole grid value? Also, should this be submitted as an enhancement request or is it impossible?

I can come up with a sample if anyone needs to see one. Thank you in advance

klodoma1
9 Nov 2011, 5:20 AM
Hi,

Did you got a solution for this?
I am looking for a solution to remove the sort of a grid programatically.

Regards, Andrei.

ruslan.talpa
5 Jun 2013, 1:57 AM
You add this function to the grid



getState: function(){
var me = this,
state = me.callParent();
delete state.sort;
return state;
},