dijit/ColorPalette
Among the more interesting properties of this widget are:
• palette – A string of either "7x10" or "3x4" describing the size of the palette.
• value – The currently selected color.
The Data Grid
Arguably one of the most important widgets in the Dojo set is the Data Grid widget. This is a table
widget that displays data in rows and columns.
The Data Grid is contained in the module called "dojox/grid/DataGrid" so any page or
script which uses it should include:
require(["dojox/grid/DataGrid"], function(DataGrid) {…});
The creation of an example new DataGrid looks like:
var grid = new DataGrid({
query: { id: "*" },
structure: [
{ name: "A", field: "A", width: "50px" },
{ name: "B", field: "B", width: "50px" },
{ name: "C", field: "C", width: "50px" }
]
}, "testGrid");
grid.startup();
Remember to call the grid.startup()implicitly or explicitly!! it is very easy to omit.
The columns in the grid are defined by the "structure" object described in more detail later.
After a grid is shown, its structure can be changed at a later time using the setStructure()
method.
The DataGrid itself is defined with the following properties:
• data-dojo-id – The name of a global variable that will hold a reference to the Widget.
• store – The name of a variable used to hold the Store data.
• rowSelector – A CSS width selector or "true" to show an area on the left for selection
Page 174
Kommentare zu diesen Handbüchern