Results 1 to 8 of 8

Thread: refresh grid

  1. #1
    Ext User Sgt.Pepper's Avatar
    Join Date
    Jun 2009
    Location
    Dsseldorf, Germany
    Posts
    41

    Default refresh grid

    Hello,

    I have a GridPanel with a store behind it.

    Now I programatically change a record in the store.

    How can I trigger the grid, to show the updated value from the store?

  2. #2

    Default

    grid.refresh();

  3. #3
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    No, the grid will automatically update if you change a record in the store.

    How did you change the record? You should be using:
    Code:
    // change single value
    record.set('field1', value1);
    
    // change multiple values
    record.beginEdit();
    record.set('field1', value1);
    record.set('field2', value2);
    record.endEdit();

  4. #4

    Default

    This is from the examples
    Code:
    rowEditor.stopEditing();
    store.insert(0,newObj);
                    grid.getView().refresh();
                    grid.getSelectionModel().selectRow(0);
                    rowEditor.startEditing(0);

  5. #5
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    Strange, the refresh() call really isn't needed (insert will fire an add event that the grid uses to update).

  6. #6

    Default

    I hear ya.
    But. This is the only way that I have used code to insert stuff into a grid.
    Sometimes the examples are a little confusing. Since. It appears that there are numerous
    ways to get from point A-B

  7. #7
    Ext User Sgt.Pepper's Avatar
    Join Date
    Jun 2009
    Location
    Dsseldorf, Germany
    Posts
    41

    Default

    Thank you for your replies.

    Instead of
    Code:
    record.beginEdit()
    record.set('X','Y')
    I was just doing a
    Code:
    record.data.X = Y
    With the correct functions, everything works fine and the grid gets updated automatically...

  8. #8

    Cool

    Thanks for the reply.
    But. Your response has no bearing on the abysmal Grid rendering issues. The render/resize issues are even worse on Windows IE. Its time to have a look at Flex.

Posting Permissions

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