Results 1 to 2 of 2

Thread: DataGrid not being re-rendered automatically after store's record has changed

  1. #1
    Sencha User
    Join Date
    Nov 2012
    Vote Rating

    Default DataGrid not being re-rendered automatically after store's record has changed

    We just upgraded from ExtJS 4.1 to 4.2 and saw an issue with GridPanel auto re-rendering when store's record data gets changed programmatically.
    In Ext 4.1, when we update the store's record with record.set ('field_name', new_value), the grid will re-render itself automatically showing the updated data. In Ext4.2, this is no longer happening.

    As a workaround, we now need to bind to store's update event, and manually re-render the grid by

    Is this expected behavior or is this a bug?
    As I compare ExtJS 4.1 and 4.2, it looks like in both cases, the datachanged event is fired once and only once when the store was initially loaded with server data (not fired again when we do record.set), so datachanged event firing does not seem to be the issue that is causing this difference in grid rendering behavior.

  2. #2
    Sencha Premium User mankz's Avatar
    Join Date
    Nov 2007
    Stockholm, Sweden
    Vote Rating


    Need a test case to know for sure, but if you review the grid internal code it's trying to be very very smart about things and only update cells where a particular Model field (defined as dataIndex) is used. The only surefire way to trigger a refresh seems to manually calling onUpdate on the gridView after a record has changed...

    This is the root cause:

    shouldUpdateCell: function(record, column, changedFieldNames){
            // Though this may not be the most efficient, a renderer could be dependent on any field in the
            // store, so we must always update the cell.
            // If no changeFieldNames array was passed, we have to assume that that information
            // is unknown and update all cells.
            if (column.hasCustomRenderer || !changedFieldNames) {
                return true;
            if (changedFieldNames) {
                var len = changedFieldNames.length,
                    i, field;
                for (i = 0; i < len; ++i) {
                    field = changedFieldNames[i];
                    if (field === column.dataIndex || field === record.idProperty) {
                        return true;
            return false;

Posting Permissions

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