1. #1
    Sencha User ing.amdangelo@gmail.com's Avatar
    Join Date
    Jun 2011
    Location
    Maddaloni (CE) Italy
    Posts
    6
    Vote Rating
    0
    ing.amdangelo@gmail.com is on a distinguished road

      0  

    Default I need Help

    I need Help


    I've a grid with pagination and order by data desc, when i insert a record in this grid with a window (it's not a editor grid panel), how set the grid on the page of the last insert record ??
    This is possible ??

  2. #2
    Sencha - Community Support Team sword-it's Avatar
    Join Date
    May 2012
    Location
    Istanbul
    Posts
    1,333
    Vote Rating
    85
    sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough

      0  

    Default


    Hi,

    May be you can provide more info about your need ,for better understanding the problem
    as i understood your problem, try following code for insert record into grid ,after click on save button of your window:

    Code:
    var record = new (yourGrid.store.recordType)(formvalues);
                yourGrid.store.insert(0, record);
    sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.

  3. #3
    Sencha User ing.amdangelo@gmail.com's Avatar
    Join Date
    Jun 2011
    Location
    Maddaloni (CE) Italy
    Posts
    6
    Vote Rating
    0
    ing.amdangelo@gmail.com is on a distinguished road

      0  

    Default Details

    Details


    I don't insert in the store, i insert directly in db ..........

  4. #4
    Sencha - Community Support Team sword-it's Avatar
    Join Date
    May 2012
    Location
    Istanbul
    Posts
    1,333
    Vote Rating
    85
    sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough

      0  

    Default


    Hi,

    could you explain exactly what you want or provide your code ,
    sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.

  5. #5
    Sencha User
    Join Date
    Jan 2011
    Posts
    544
    Vote Rating
    51
    willigogs is a jewel in the rough willigogs is a jewel in the rough willigogs is a jewel in the rough

      0  

    Default


    If I understand what is being requested, then you would need to do the following:
    1. You add a new record to the DB
    2. In your server success response, you will have to do some backend logic to check WHERE this has been inserted according to your sorting method - then return this. E.g. if it was a database of people, and you just added "Peter Parker", you would then return something like "success: true, recordnumber: 577".
    3. You then divide this returned number by your paging amount to know what page it would be listed on.
    4. Use the pagingbar's changePage() method to load the correct page of results where this record has just been added to
    http://docs.sencha.com/ext-js/3-4/#!...hod-changePage

Thread Participants: 2

Tags for this Thread