:: Documentation >>

cell model

Contains the properties (text, image, tooltip etc.) of the grid cell.

The cell model implements the default get and set methods for accessing the cell data in javascript arrays. The external cell model object can be attached to replace all or some of the built-in cell methods to allow different types of cell data sources (XML, CSV etc.).

Syntax

var value = obj.getCellProperty(name); // Retrieve property by name
obj.setCellProperty(name, value);      // Assign property value
obj.defineCellProperty(name, value);   // Define new property

var external = obj.getCellModel();     // Get reference to external model
obj.setCellModel(external);            // Assign external model
obj.clearCellModel();                  // Clear/reset all properties

Properties

dataCell data.
editableIndicates whether the cell can be edited.
formatCell formatting object.
imageCell image.
linkCell hyperlink URL.
selectedIndicates whether the cell is selected.
stateCell state.
textCell text.
tooltipCell tooltip.
valueCell value.

Defined in

AW.UI.Grid

Used by

cell template

Examples

Loading cell data from the javascript array

var myCells = [
 ["MSFT","Microsoft Corporation", "314,571.156", "32,187.000"],
 ["ORCL", "Oracle Corporation", "62,615.266", "9,519.000"],
 ["SAP", "SAP AG (ADR)", "40,986.328", "8,296.420"]
];

var obj = new AW.UI.Grid;

obj.setCellText(myCells); // link to the js array
obj.setColumnCount(4);
obj.setRowCount(3);

document.write(obj);

Using external XML datasource

var table = new AW.XML.Table;
table.setURL("/examples/data/companies-simple.xml");
table.request();

var obj = new AW.UI.Grid;
obj.setCellModel(table); // assign external cell datasource
obj.setColumnCount(5);

CSV text file

var table = new AW.CSV.Table;
table.setURL("/examples/data/companies.txt");
table.request();

var obj = new AW.UI.Grid;
obj.setCellModel(table); // assign external cell datasource
obj.setColumnCount(5);

See also

Loading grid data: javascript arrays, XML, CSV

Comments

Philosophy of setCellData vs setCellText G. Cayman (13)
Editing and getCellData MP (4)

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