Success! Looks like we've fixed this one. According to our records the fix was applied for EXTJS-8823 in a recent build.
  1. #1
    Touch Premium Member pmarko's Avatar
    Join Date
    Dec 2007
    Location
    Ireland
    Posts
    56
    Vote Rating
    1
    pmarko is on a distinguished road

      0  

    Default [4.2.0.555] Ext.view.Table does not refresh columns on model.save

    [4.2.0.555] Ext.view.Table does not refresh columns on model.save


    Hi Folks,

    Ext.View.Table does not refresh columns when model.save on model instance already existing in store is performed as changedFieldNames in shouldUpdateCell method is null.

    PHP Code:
    shouldUpdateCell: function(recordcolumnchangedFieldNames){
            
    // 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 (column.hasCustomRenderer) {
                return 
    true;
            }
            
            if (
    changedFieldNames) {
                var 
    len changedFieldNames.length,
                    
    ifield;
                    
                for (
    0len; ++i) {
                    
    field changedFieldNames[i];
                    if (
    field === column.dataIndex || field === record.idProperty) {
                        return 
    true;
                    }
                }
            }
            return 
    false;
        }, 
    as it is called via Ext.view.Table.updateColumns
    PHP Code:

    updateColumns
    : function(recordoldRowDomnewRowDomcolumnschangedFieldNames) {

    for (
    colIndex 0colIndex colCountcolIndex++) {
                
    column columns[colIndex];

                
    // If the field at this column index was changed, or column has a custom renderer
                // (which means value could rely on any other changed field) the update the cell's content.
                
    if (me.shouldUpdateCell(recordcolumnchangedFieldNames)) { ....


    and so on..

    from Ext.data.AbstractStore.afterCommit

    PHP Code:
        afterCommit : function(record) {
            
    // Must pass the 5th param (modifiedFieldNames) as null, otherwise the
            // event firing machinery appends the listeners "options" object to the arg list
            // which may get used as the modified fields array by a handler.
            // This array is used for selective grid cell updating by Grid View.
            // Null will be treated as though all cells need updating.
            
    this.onUpdate(recordExt.data.Model.COMMITnull);
            
    this.fireEvent('update'thisrecordExt.data.Model.COMMITnull);
        }, 
    I think this should do the trick

    PHP Code:
    shouldUpdateCell: function(recordcolumnchangedFieldNames){
            
            
    // update all cells if changedFieldNames is not set
            
    if(!changedFieldNames){
                return 
    true;
            }
          
            
    // 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 (column.hasCustomRenderer) {
                return 
    true;
            }
            
            if (
    changedFieldNames) {
                var 
    len changedFieldNames.length,
                    
    ifield;
                    
                for (
    0len; ++i) {
                    
    field changedFieldNames[i];
                    if (
    field === column.dataIndex || field === record.idProperty) {
                        return 
    true;
                    }
                }
            }
            return 
    false;
        }, 

  2. #2
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,505
    Vote Rating
    53
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    Thanks for the report! I have opened a bug in our bug tracker.

Thread Participants: 1