Results 1 to 4 of 4

Thread: [Modern 6.5.1] Column has no sorter when pre-sorted store added to a grid

    You found a bug! We've classified it as EXTJS-23380 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha Premium User
    Join Date
    Jan 2017
    Posts
    12

    Default [Modern 6.5.1] Column has no sorter when pre-sorted store added to a grid

    Hi,

    when I set a pre-sorted store to a grid, the sorted column doesn't display any icon for the sorting directory. Because the column hasn't a sorter and sorter state.

    Here's my fiddle:
    https://fiddle.sencha.com/#view/editor&fiddle/25k0

    I have a done an override:
    Code:
    /** * If the store contains any sorter the store will be sorted but the sort icon (.x-gridcolumn.x-sorted-[asc/desc])
     * won't be displayed in the column header.
     * We set the sorter for the column manually after the Store was sorted.
     * @since 6.5.1
     */
    setStore: function (store) {
        this.callSuper(arguments);
        if (store && store.isSorted()) {
            this._onSort(store);
        }
    },
    
    _onSort: function (store) {
        var me = this,
            columns = me.getColumns(),
            isSorted = store.isSorted(),
            sorters = store && store.getSorters();
    
        if (isSorted && columns && sorters && sorters.length > 0) {
            Ext.Array.forEach(columns, function (column) {
                let sorter = sorters.get(column.getSortParam());
                if (sorter && column.getSorter() !== sorter) {
                    column.setSorter(sorter);
                    column.setSortState(sorter);
                }
            });
        }
    }
    Thanks

  2. #2
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985

    Default

    Thanks for the report. We're tracking this one as EXTJS-23380.

  3. #3
    Sencha Premium User
    Join Date
    Feb 2012
    Posts
    82

    Default

    Quote Originally Posted by Gary Schlosberg View Post
    Thanks for the report. We're tracking this one as EXTJS-23380.
    Don't suppose there's any news on this? Or a workaround?

  4. #4
    Sencha User
    Join Date
    Apr 2013
    Posts
    908

    Default

    Quote Originally Posted by mattjenkins View Post
    Don't suppose there's any news on this? Or a workaround?
    If you look above, you'll see an override...

Similar Threads

  1. Replies: 1
    Last Post: 28 Apr 2017, 2:14 AM
  2. [OPEN] Ext.grid.column.Column sorter config is private
    By joshglendenning in forum Sencha Documentation
    Replies: 2
    Last Post: 7 Mar 2017, 7:59 AM
  3. Ext.grid.column.Column sorter issue
    By wapiko in forum Sencha Ext JS Q&A
    Replies: 0
    Last Post: 11 May 2016, 4:46 PM
  4. Replies: 3
    Last Post: 4 Mar 2013, 8:11 AM
  5. Replies: 2
    Last Post: 29 May 2012, 7:15 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •