:: Documentation >>

cell value

Sets or retrieves the grid cell values. While the cell text property is used for the display text the cell value is used for the calculations or data processing tasks (sort, filter).

The cell value is obtained from the cell data or cell text using cell formats converter object (dataToValue or textToValue methods).

Syntax

var value = obj.getCellValue(); 
obj.setCellValue(value);        

obj.onCellValueChanging = function(value){...}; 
obj.onCellValueChanged = function(value){...}; 
obj.onCellValueError = function(value){...}; 

Defined in

cell model

Examples

Assign the content to the cell data and convert it with the cell formats

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

var string = new AW.Formats.String;
var number = new AW.Formats.Number;
var date = new AW.Formats.Date;

number.setTextFormat("#,###.##");
date.setDataFormat("ISO8601");
date.setTextFormat("mmm d, yyyy");

var obj = new AW.UI.Grid;
obj.setCellData(myCells);
obj.setCellFormat([string, number, date]);
obj.setColumnCount(3);
obj.setRowCount(2);
document.write(obj);

Assign the content directly to the cell text and add the cell formats for the correct sorting.

var myCells = [
    ["Cell <i>text</i>", "123", "5/18/2004"],
    ["<a href='#'>More...</a>", "456", "1/12/2006"]
]

var html = new AW.Formats.HTML;
var number = new AW.Formats.Number;
var date = new AW.Formats.Date;

var obj = new AW.UI.Grid;
obj.setCellText(myCells); 
obj.setCellFormat([html, number, date]); 
obj.setColumnCount(3);
obj.setRowCount(2);
document.write(obj);

See also

Overview: using format converters
Grid templates: cell
Cell model: text, image, tooltip, link, data, format, editable, state, selected

Comments

get especific value column in the row selected? Anderson RS, Brazil. thank's (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