Results 1 to 5 of 5

Thread: I need Help

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha User ing.amdangelo@gmail.com's Avatar
    Join Date
    Jun 2011
    Location
    Maddaloni (CE) Italy
    Posts
    6
    Vote Rating
    0
      0  

    Default 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 User sword-it's Avatar
    Join Date
    May 2012
    Location
    Istanbul
    Posts
    1,335
    Vote Rating
    91
      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
      0  

    Default Details

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

  4. #4
    Sencha User sword-it's Avatar
    Join Date
    May 2012
    Location
    Istanbul
    Posts
    1,335
    Vote Rating
    91
      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
    549
    Vote Rating
    54
      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

Tags for this Thread

Posting Permissions

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