You can configure the wijgrid columns individually by specifying a 'columns' option that contains an array with options for each column, like in this code sample.
Sample Script |
Copy Code |
$("#demo").wijgrid({
/* bind data */
data: salesData,
/* configure grid */
allowEditing: true,
highlightCurrentCell: true,
/* configure grid columns */
columns: [
{readOnly: true}, /* first column is read-only */
{dataType:'number', dataFormatString:'n0'} /* second column is numeric */
]
});
|
The options available for the columns are described in the Wijmo API documentation under IColumn.
Particularly useful column options include:
- allowMoving: Specifies whether you can drag the column with the mouse to a new position.
- allowSizing: Specifies whether you can resize the column with the mouse.
- headerText: Specifies text to show on the column header.
- allowSort: Specifies whether you can sort the column by clicking the header with the mouse.
- dataType: Specifies the type of data that the column contains (also governs content alignment).
- dataFormatString: Specifies the format string used to format the data in the column.
- readOnly: Specifies whether you can edit cells in this column.
- valueRequired: Specifies whether to accept null values when you edit cells in this column.
See Also