• hidden – A boolean. When set to true, the column is hidden.
• classes – A set of CSS class names used to style the column
The DataGrid also supports the following events:
• onMouseOver
• onMouseOut
• onRowClick
• onRowDblClick
• onRowContextMenu
• onSelectionChanged
• … more
In order to use the Data Grid, one must also include CSS styles:
<link rel="stylesheet"
href="http://ajax.googleapis.com/ajax/libs/dojo/1.7.1/dojo/resources/dojo.css">
<link rel="stylesheet"
href="http://ajax.googleapis.com/ajax/libs/dojo/1.7.1/dijit/themes/claro/claro.css">
<link rel="stylesheet"
href="http://ajax.googleapis.com/ajax/libs/dojo/1.7.1/dojox/grid/resources/claroGrid.css">
See also:
• Dojo Toolkit – dojox.data.DataGrid
• Sitepen – Introduction to the DataGrid – 1.7
• Sitepen – Connecting a Store to a Datagrid – 1.7
• Sitepen – Populating your Grid using dojo/data – 1.7
• Sitepen – Working with the Grid – 1.7
• Sitepen – New Features in Dojo Grid 1.2 – 2008-10-22
• Dojo Grid Widget Updated. Data Integration and Editing Improvements – 2008-07-16
• Sitepen – Dojo 1.2 Grid – 2008-07-14
• Sitepen – Dojo Grids: Diving Deeper – 2007-11-13
• Sitepen – Simple Dojo Grids – 2007-11-06
Setting Grid data
The data supplied to the grid to be shown should be a store supplied via the grid's
setStore(myStore) method.
Editable cells
A Data Grid's cells can be editable. In order to allow them to be edited, the column must be flagged
as editable. This can be set in the <th> tag with the attribute editable="true". For example:
<th field="a" editable="true">Column A </th>
The Data Store associated with the grid must also support the dojo.data.api.Write
interface. By default, an editable cell is in a view only mode. To edit the cell, it must be double
clicked to place it into an editing mode. An optional attribute called "alwaysEditing" can be
added so that the field can be edited just by typing into it.
<th field="a" alwaysEditing="true" editable="true">Column A</th>
Page 176
Comentários a estes Manuais