DojoGrid

The DojoGrid widget displays data in a table.

Properties

behaviors
Defines the function that is invoked for each cell
columns
Defines the columns in the table
data
An array of records that contains information to put into the table. Specify as data=(array_name as any[]), where array_name is the name of the array.
headerBehaviors
Defines the function that is invoked for each header cell

Events

onGridRowClick
The action to occur when the row is selected

Functions

addRow
Adds a row to the table
removeRow
Removes a row from the table

Example

The following example shows the code and output for the DojoGrid widget.


DojoGrid {marginLeft=20, behaviors = [ addEditors, centerColumns ],
				 headerBehaviors = [ resize, centerColumns ],
				 columns = [new DojoGridColumn {name="SelectQuote",displayName="X",width=17},
				            new DojoGridColumn {name="Symbol"},
				            new DojoGridColumn {name="Quote",displayName="Price"},
				            new DojoGridColumn {name="NumShares", displayName="Shares"}], 
			data = [new Stock{Symbol="Company1",Quote=100,NumShares=4,SelectQuote=false}, 
				     new Stock{Symbol="Company2",Quote=200,NumShares=100,SelectQuote=false}, 
				     new Stock{Symbol="Company3",Quote=200,NumShares=15,SelectQuote=false}, 
				     new Stock{Symbol="Company4",Quote=120,NumShares=10,SelectQuote=true}, 
				     new Stock{Symbol="Company5",Quote=200,NumShares=20,SelectQuote=false}]}

Graphic of a table that contains four columns and five rows.

Feedback