• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

[SOLVED] How Do I Update A Store & Grid Value After Load Has Fired

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [SOLVED] How Do I Update A Store & Grid Value After Load Has Fired

    I am running into a bit of a snag. The version of Valence we are on does not support an extended use of calculated fields in vvOut_execSQLtoJSON. Therefore I have 2 options:

    1. Use native RPG reads and build the JSON manually
    2. Excluded the calculated fields from the SQLtoJSON and calculate them on the front end

    For this "exercise" I'd like to take option 2.

    I tried using the load listener for my data store that is attached to the grid. I can change the value of anything in the store using store.data.items[0].raw.MYFIELD = myvalue. However, this does not update the grid. I cannot refresh the grid or it reloads the store again. Is there a way to refresh the grid with the contents in the store without reloading the entire store (ergo making another ajax request)?

  • #2
    Anytime you are updating a record in a store, you should use the .set method on the record. This will then fire an event to ensure that any view bound to it will be updated.

    Alternately, you can specify a "convert" function on your model and change the data before the grid even renders it.

    Comment


    • #3
      Sean,

      Thanks for your response! This indeed did update the store value and the grid value!

      This is making the cell "dirty" (red triangle in upper left corner). How do you "clean" it after the 'set'? I tried changing the dirty property but that did not work.

      Comment


      • #4
        Glad to help...

        record.commit();

        Comment

        Working...
        X