DataGrid.setCellValueInSource

Syntax

setCellValueInSource(rowIndex: Number, colIndex: String, value: Number|String|Boolean, rawValue: Number|String|Boolean);

Parameters

rowIndex. Table row index.

colIndex. Table column identifier.

value. Unformatted table cell value.

rawValue. Formatted table cell value.

Description

The setCellValueInSource method sets new cell value from table data source.

Example

To execute the example, the HTML page must contain the DataGrid component named grid (see Example of Creating an Asynchronous Data Table). Set value for the table cell located at the intersection of the row with the 0 index and the column with the popul identifier:

// Set a new value for table cell
grid.setCellValueInSource(0, "popul", 7, "7.00");
// Refresh table
grid.refresh();
// Get cells with changed value
var changedCells = grid.getChangedCells();
for(var i in changedCells) {
    var column = changedCells[i];
    for(var j in column) {
        console.log("Cell value (%s, %s): %s", i,  j, column[j]["@FT"]);
    }
}

After executing the example the 7.00 value is set for the table cell located at the intersection of the row with the 0 index and the column with the popul identifier. The browser console displayed a message about this event:

Cell value (0, popul): 7.00

See also:

DataGrid