mleibman/SlickGrid — Issue #260: getDataItemValueForColumn not used in enough places!
Author: taffyboiy
Created: 2012-01-02 20:01:51+00:00
State: open

Hi,

I see someone else has pointed out the editors fail to use the ability to specify an array of fields - but the grid code itself also fails to call this function. (If you add some editing capability to your example for this functionality you'll see what I mean) The effect is to set the cell value to the entire row when completing or abandoning the edit. So far I've found a few places which need updating

in the function updateRow, the line which reads
// this.innerHTML = getFormatter(row, m)(row, i, getDataItem(row)[m.field], m, getDataItem(row));
needs to be something like
// this.innerHTML = getFormatter(row, m)(row, i, getDataItemValueForColumn(getDataItem(row), m), m, getDataItem(row));

Make Active Cell normal needs a replacement similar to the one below

//activeCellNode.innerHTML = getFormatter(activeRow, column)(activeRow, activeCell, getDataItem(activeRow)[column.field], column, getDataItem(activeRow));

// activeCellNode.innerHTML = getFormatter(activeRow, column)(activeRow, activeCell, // getDataItemValueForColumn(getDataItem(activeRow), column), column, getDataItem(activeRow));

the function updateCell is also affected I think, as it also uses m.field (which could now point to an array rather than a string)

Many thanks for a fantastic grid. :-)