[CLOSED] How to stop ReSorting in grid on cell edit.

  1. #1

    [CLOSED] How to stop ReSorting in grid on cell edit.

    Hi,

    I am facing one problem on-grid edit. I am facing this problem after update version 2 to version 5.
    Steps are mention below:

    On version 5 use URL: https://examples5.ext.net/#/GridPane..._DirectMethod/
    1. On the grid Sort desc of column 4 - "Change" column (1.09, 0.92, 0.86, 0.73......)
    2. Now change the value 0.92 to 0.75 and press tab key or click outside anywhere
    Result: the Second row which you edited, it's automatically shifted on 3rd place (1.09, 0.86, 0.75, 0.73.......)

    On version 2 use URL: https://examples2.ext.net/#/GridPane..._DirectMethod/
    1. On the grid Sort desc of column 4 - "Change" column (1.09, 0.92, 0.86, 0.73......)
    2. Now change the value 0.92 to 0.75 and press tab key or click outside anywhere
    Result: the Second row which you edited, it's not shifted anywhere (1.09, 0.75, 0.86, 0.73.......)

    I want the behavior of version 2 in version 5.

    So I don't want this auto resorting when grid in edit mode.
    Last edited by fabricio.murta; Jan 16, 2020 at 5:30 PM.
  2. #2
    Hello @MidnightRiders, and welcome to Ext.NET forums!

    First, thanks for the very easy to follow instructions on reproducing your issue. It really helps us understand your problem and give you appropriate advice!

    To the problem in hands, all you need to do to recall Ext.NET 2's behavior is, clear the grid sorters. It won't "de-sort" back to what it was previously, and it won't clear the last ordered column arrow in the column header cell. But if you modify the grid in another way besides editing cells, you might want to re-enable the sorters -- and for that you'd need to save it somewhere before you clear the sorters.

    To clear sorters right before the first edit action, in the example you pointed, within the ext:CellEditing's Listeners block, add the following listener:

    <BeforeEdit Handler="item.grid.getStore().sorters.clear();" />
    In case you want the sorter to be lifted as soon as the grid is sorted (instead of waiting until an edit happens), you can just add the same handler to the grid panel's SortChange listener. For instance, still in the same example, add this Listener block within the ext:GridPanel block:

    <Listeners>
        <SortChange Handler="this.getStore().sorters.clear();" />
    </Listeners>
    With this, you would no longer need the BeforeSort listener in the editor plugin and anything else that changes the grid after it is sorted won't trigger a re-sort.

    This answer is based in a discussion on the same issue undergone in the following thread from Sencha forums: How to avoid sorting when grid cell editing

    Hope this helps!
    Fabrício Murta
    Developer & Support Expert
  3. #3

    Thanks

    Yes, It's very helpful.

    Thanks A lot. :)
  4. #4
    Thanks for the feedback, and glad it helped!

    We're tagging this thread as "closed", then.
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. Replies: 5
    Last Post: Mar 12, 2018, 4:26 PM
  2. [CLOSED] problem layout grid panel group after edit cell
    By marco.morreale in forum 2.x Legacy Premium Help
    Replies: 5
    Last Post: May 23, 2014, 1:23 PM
  3. Replies: 3
    Last Post: Oct 11, 2013, 10:28 PM
  4. [CLOSED] Insert Grid Record - Edit First Cell?
    By peter.campbell in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: May 10, 2011, 11:01 AM
  5. TreeGrid cell edit
    By Roman in forum 1.x Help
    Replies: 2
    Last Post: Mar 22, 2011, 4:01 PM

Posting Permissions