Represents a column in a grid control.
Namespace: MindFusion.DataViews
File: GridColumn.js
Syntax
JavaScript
Copy Code
|
---|
// class GridColumn.prototype = {} |
Example
The following code creates a new Grid instance with 3 GridColumn-s and sets some of the Grid properties:
JavaScript
Copy Code
|
---|
var dv = MindFusion.DataViews; var column1 = new dv.GridColumn("index"); column1.dataType = dv.IntegerType; column1.editable = false; column1.caption = "#"; columns.push(column1); var column2 = new dv.GridColumn("name"); column2.dataType = dv.StringType; column2.caption = "Name"; columns.push(column2); var column3 = new dv.GridColumn("state"); column3.dataType = dv.LookupType; column3.caption = "State"; column3.metaData.set("values", states.map(s => [s["Name"]])); columns.push(column3); var columns = [column1, column2, column3]; // create the grid control var grid = new dv.Grid(document.getElementById("grid")); grid.theme = "business"; // disable inplace editing grid.allowEdit = false; // do not show "New row" option in context menu grid.allowAppend = false; // do not show "Delete Row" option in context menu grid.allowDelete = false; // disable single cell selection grid.allowCellSelect = false; // set the model grid.model = new dv.ArrayModel(participants, columns); //the first column is sorted grit.sortedColumn = 0; |
Inheritance Hierarchy
MindFusion.DataViews.GridColumn
See Also