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 6709913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:56:17+00:00 2026-05-26T07:56:17+00:00

I have a nice working Ext.grid.Panel, with column headers you can click on to

  • 0

I have a nice working Ext.grid.Panel, with column headers you can click on to “automatic” sort.
The store has “autoSync: true”.
I have a button “new”, when the user clicks on it, it creates an empty record without the id property:

onAddClick: function(){
    this.down('#new').setDisabled(true);
    var rec = new GroupeSynergies.data.Partenaire({
        /* Valeurs par défaut des colonnes */
        description: 'Nouveau partenaire'
    });
    this.store.insert(0, rec);
},

I insert the record in the #0 position, because I know that it’ll be automatically synced (and that’s what’s happening actually).
The problem is: if you click on the “id” column, it’s sorted by id asc, if you click again, reverse order.

Then you click on the button “New”, it creates empty new record, sends it to the server, and gets the resulting record with the id field completed, updates the grid, but… don’t take in account the sort: when it’s synced, the returned id is very high and it stays on the top, no matter what the sort order is. What am I doing wrong?

Thank you very much

(PS I’m asking at stackoverflow because Sencha’s forum seems to be overwhelmed)

  • 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-05-26T07:56:18+00:00Added an answer on May 26, 2026 at 7:56 am

    In a similar situation, the solution I’ve found is to add a store.sort in the ‘write’ event handler of the store.

    Ext.application({
    
        (...)
    
        launch: function() {
    
            var myStore = this.getStore('myStore');
            myStore.on('write', function(store, operation){ store.sort('id','ASC') }; );
    
        }
    
    });
    

    Adapt the sorting parameter to your needs. Documentation for the ‘sort’ method.

    If you have a writer set on the proxy of your store, the sorting will also fire for a simple “update”. To avoid this situation you can test the value of the operation parameter.
    Documentation for the ‘write’ event.

    I don’t know if it is the better way of doing it, it’s the only one I’ve found for now.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have SQL query, which is working nice on Oracle and MSSQL. Now I'm
I have a nice working slider script (no libraries used). I need a math
I have a nice little app on the app store that does pretty well
I followed this tutorial, for now it's working nice, but i only have a
I have a nice working iphone app that works with core data. I use
I have a FB app that is working nice with the postbacks from within
i have been looking around to find some nice working example of implementing Membership
actually i'm working with .Net Framework 3.5, so i have all these nice little
I have some nice, working edit-undo functionality in my winforms application. It works using
I have a resque-scheduler delayed job that is queued properly. Everything is working nice

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.