PDA

View Full Version : Ext Direct + Grid filter example: How to clear sort?



stewardsencha
18 Mar 2012, 2:50 PM
Building on the grid-filter example using ExtDirect.

The "clear filters" button wipes out the filters, but leave whatever column sorts were in place.



{
text: 'Clear Filter Data',
handler: function () {
grid.filters.clearFilters();
// Here, want to reset all columns to be unsorted
}
}



... where do I start looking to empty the filters of sort info?

I don't know what gets flipped when a user clicks on a sortable column header.

I see ways to remove the ability to sort. But not to just revert to unsorted for all columns.

mitchellsimoens
19 Mar 2012, 8:13 AM
Is this using the filters feature or just having plain filters on a store?

stewardsencha
19 Mar 2012, 8:30 AM
http://docs.sencha.com/ext-js/4-0/#!/example/grid-filtering/grid-filter-local.html



var grid = Ext.create('Ext.grid.Panel', {
border: false,
store: store,
columns: createColumns(4),
loadMask: true,
features: [filters],
...