[ANSWERED] click Sort icon of column header programmatically

Our blazing fast Grid component built with pure JavaScript


User avatar
mats
Core Developer
Core Developer
Posts: 15906
Joined: Sat Dec 19, 2009 11:41 pm
Location: Sweden
Contact:

Re: click Sort icon of columna header programmaticaly

Post by mats »

Try this:

Code: Select all

grid.store.sort({ field : yourColumn.field, fn : yourColumn.sortable})
Tired of debugging javascript errors in web applications? Try our new error logging service RootCause, or read more on the Sencha blog

@bryntum
Facebook
API documentation

User avatar
eguardiola
Posts: 8
Joined: Sat Mar 07, 2020 3:12 pm

Re: click Sort icon of column header programmatically

Post by eguardiola »

Thanks. That way apparently is doing the same as when i click the sort icon on the header. But when i call store.filterBy() the sorting status is lost. The sorting status remains when the sort is enabled by clicking the sort icon. :-/

User avatar
pmiklashevich
Core Developer
Core Developer
Posts: 2756
Joined: Fri Apr 01, 2016 11:08 am

Re: click Sort icon of column header programmatically

Post by pmiklashevich »

I cannot reproduce the issue. filterBy doesn't clear sorting for me. Could you please provide detailed steps how to reproduce the problem with one of our examples (for example in console), or provide a runnable testcase that we can check?
Pavel Miklashevich - Core Developer

User avatar
eguardiola
Posts: 8
Joined: Sat Mar 07, 2020 3:12 pm

Re: click Sort icon of column header programmatically

Post by eguardiola »

Hi,

Finally the way it works like i need is in this way:

Code: Select all

grid.store.sort({ field : yourColumn.field, fn : myCustomFunction}, false)
Thanks!

Post Reply