Results 1 to 6 of 6

Thread: Reloading a single record droma grid

  1. #1
    Sencha User
    Join Date
    Jun 2012
    Posts
    21
    Vote Rating
    7
      0  

    Default Reloading a single record droma grid

    I have a grid. How can I refresh a single record? My models have defind a load data. My store alse has a direct proxy. What i want that sometimes a single record would get his data from the server, and not he whole grid.

    For example after I edit a row in a form i want my grid to reload only one row.

    Info: I do not want to use the record from the form because that one is not the same model, but they do have the same id. I use ExtJS 4.1.1a

  2. #2
    Sencha Premium Member vadimv's Avatar
    Join Date
    Sep 2010
    Location
    Cluj, Romania
    Posts
    788
    Answers
    23
    Vote Rating
    58
      0  

    Default

    Use the static Model.load(id,config) and in success callback update your record with the new data, then commit the changes,

    Edit: then do grid.getView().refreshNode(rec_index).
    Last edited by vadimv; 9 Mar 2013 at 2:20 AM. Reason: Updated, to complete the answer
    Github https://github.com/vadimpopa
    Blogging @ : http://vadimpopa.com
    Twitter: @vadimvpopa

  3. #3
    Sencha User
    Join Date
    Jun 2012
    Posts
    21
    Vote Rating
    7
      0  

    Default

    Donw that, but The row does not refresh. I want oly that row to refresh.

  4. #4
    Sencha Premium Member vadimv's Avatar
    Join Date
    Sep 2010
    Location
    Cluj, Romania
    Posts
    788
    Answers
    23
    Vote Rating
    58
      0  

    Default

    don't complicate yourself, do grid.getView().refresh()
    Github https://github.com/vadimpopa
    Blogging @ : http://vadimpopa.com
    Twitter: @vadimvpopa

  5. #5
    Sencha User
    Join Date
    Jun 2012
    Posts
    21
    Vote Rating
    7
      0  

    Default

    I love keepin simple, but having 1000 celsl, half of them having special renderers makes me think twice before rendering the whole table.

  6. #6
    Sencha Premium Member vadimv's Avatar
    Join Date
    Sep 2010
    Location
    Cluj, Romania
    Posts
    788
    Answers
    23
    Vote Rating
    58
      1  

    Default

    ah haven't noticed grid.getView().refreshNode() . Updated my first replay, to complete the answer to your question, and the code example here : http://vadimpopa.com/reload-a-single...xtjs-grid-row/
    Github https://github.com/vadimpopa
    Blogging @ : http://vadimpopa.com
    Twitter: @vadimvpopa

Posting Permissions

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