:: Documentation >>

cell data

Sets or retrieves the grid cells data. The data is assigned to the individual cell or to the array of cells depending on the type and the number of arguments in the setCellData() method (see the examples below).

The text in the grid cell is produced by applying the cell format over the cell data property. This allows encoding the html control characters (<, >, ", &) in the text strings or converting numbers and dates into specific display formats. It is more efficient to assign the content directly to the cell text property (instead of the cell data + cell format) if the client-side transformation is not required.

Syntax

var value = obj.getCellData(); 
obj.setCellData(value);        

obj.onCellDataChanging = function(value){...}; 
obj.onCellDataChanged = function(value){...}; 
obj.onCellDataError = function(value){...}; 

Defined in

cell model

Examples

Javascript array

var myCells = [
    ["Item <1>", "1234.56", "2004-05-18"],
    ["Item 1 & 2", "9876543", "2006-02-08"]
]

obj.setCellData(myCells);

Function

obj.setCellData(function(col, row){return myCells[row][col]});

Single cell

obj.setCellData("Item <1>", 0, 0); // col-0, row-0

See also

Overview: using format converters
Grid templates: cell
Cell model: text, image, tooltip, link, value, format, editable, state, selected
Data properties: selector, header, footer, top, bottom

Comments

How to get all the values of the selected row MAHESH (0)
obj.onCellDataChanged = function(value){...}; JC (1)

Documentation:

Recent changes:

2.6.4
2.6.3
2.6.2
2.6.1
2.6.1
2.6.0
2.5.0 - 2.5.6
2.5.6
2.5.0 - 2.5.5
2.5.5