Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8099391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T22:23:59+00:00 2026-06-05T22:23:59+00:00

I have a buffered grid on which I’ve implemented a local sort function (client

  • 0

I have a buffered grid on which I’ve implemented a local sort function (client side). I would like to remove the sort indication (darker background and little arrow) on the column header when the store reloads.

Does anyone know how to accomplish this in 4.1?

To make this clearer:

I want my columns to be sortable. I do not want them to initialize with sorting disabled. Users should be able to click the header and sort it all they want. But, what I want is to be able to turn off the sort programmatically. I.e., remove any sort classes that were applied from user clicks (things like the darker background and the little sort direction arrow).

The reason I would do this is because I am using a modified buffered store which allows me to do local sorting (client-side) with all of the buffered data (not just the chunk that is displayed). Normally, using a buffered store will make local sorting disabled because it would only sort the data that is displayed in the grid – not all of the data in memory, so the guys at Sencha made any grid that has a buffered store automatically disable local sorting – only remote sorting works. Well, as I said, mine is modified so it will work – but then when this buffered store reloads with new data from the database it does not enjoy the handy sortOnLoad feature normal grids get as a matter of course. In my use-case it is more logical to remove the sort state than it is to override the sortOnLoading functionality and make it apply the same sort to the new data, hence, this question.

I do have it worked out now, I’ll post an answer shortly along with my implementation of a buffered store with local sorting, in case anyone is interested and for my own future reference.

I should also point out that I am very aware of the client-side performance penalties that come with local sorting on a store that would need to be buffered (as opposed to just using remote sorting of the data on the server). I am aware that this is probably why Sencha does not support local sorting on their buffered stores. I have assessed all of the pros and cons to this and in my specific use-case it is the most sensible thing for me to do.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T22:24:01+00:00Added an answer on June 5, 2026 at 10:24 pm

    Buried deep in the dom there is a setSortState function on the Ext.grid.header.Container class and on the Ext.grid.column.Column class. These don’t show up anywhere in the 4.1.0 docs but they’re in the code nevertheless.

    You can look at these functions yourself to get a complete concept of what they do, but the gist of both them is a switch statement that looks for either a 'DESC', 'ASC' or a null in the first argument, e.g.:

    setSortState(`DESC`);
    setSortState(`ASC`);
    setSortState(null);
    

    Calling either the header version or the column version of this function with a single null argument will remove the sort classes on a column. The only real difference is that the header version looks at the grid’s store to find the active sorter in the store’s sorters property and then uses that data to determine which column to call this function on – the column version simply runs off the column object that it is called from.

    In my use-case I don’t add a sorter to the store sorters property so I am using the column version (i.e. calling setSortState from an Ext.grid.column.Column object).

    First, here is an example of my implementation of a buffered store that allows local (client-side) sorting:

    Ext.define('MyApp.store.TheBufferedStoreWithLocalSorting', {
        extend: 'Ext.data.Store',
        requires: [
            'Ext.ux.data.PagingMemoryProxy',
            'Ext.util.MixedCollection'
        ],
        model: 'MyApp.model.SomeModel',
        buffered: true,
        pageSize: 100,
        remoteSort: true, // this just keeps sorting from being disabled
        proxy: {
            type: 'pagingmemory',
            reader: 'json'
        },
        /* 
         * Custom sort function that overrides the normal store sort function.
         * Basically this pulls all the buffered data into a MixedCollection
         * and applies the sort to that, then it puts the SORTED data back
         * into the buffered store.               
         */                    
        sort: function(sorters) {
            var collection = new Ext.util.MixedCollection();
    
            collection.addAll(this.proxy.data);
            collection.sort(sorters);
            this.pageMap.clear();
            this.getProxy().data = collection.getRange();
            this.load();
    
        }
    });
    

    Now, to answer my question, to remove the sorter classes whenever the store reloads I just need to do this:

    Ext.each(myGrid.columns, function(column, index) {
        if (column.hasCls('x-column-header-sort-ASC') ||
            column.hasCls('x-column-header-sort-DESC')) {
            myGrid.columns[index].setSortState(null);
            return false;
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have a procedure which looks like Procedure TestProc(TVar1, TVar2 : variant); Begin TVar1 :=
I have client for web interface to long running process. I'd like to have
I have a java program in a UNIX environment which requires line buffered data
I have an app that uses a 2400x1800 buffered Image (which I know it
I have the following binding which works fine when I create client. <?xml version=1.0
I have a WCF service with several methods. I would like to log the
I have a large file which contains sequence of characters like ABCDEabcde.....XYZxyz. Now, I
I have a buffered image with the sizes of my frame: public BufferedImage img;
I have the following example of reading from a buffered reader: while ((inputLine =
Hi I have been using the Buffered Reader to try to read a text

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.