Search
ArrayModel.columnType Method
See Also
 






Gets the type of the specified column.

Namespace: MindFusion.DataViews
File: ArrayModel.js

 Syntax

JavaScript  Copy Code

function columnType (column)

 Parameters

column

Number. The column index.

 Return Value

DataType. The type.

 Example

The following code creates a grid with columns with different dataType and checks the type of the first column:

JavaScript  Copy Code

var dv = MindFusion.DataViews;

// create the grid columns
var columns = [];

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);

// create the grid control
var grid = new dv.Grid(document.getElementById("grid"));
grid.theme = "blue";
// set the model
grid.model = new dv.ArrayModel(participants, columns, "index");

if(grid.model.columnType(0) == dv.IntegerType)
{
    //do something
}

 See Also