Initializes a new instance of the ArrayModel class.
Namespace: MindFusion.DataViews
File: ArrayModel.js
JavaScript Copy Code |
---|
function ArrayModel (values, columns, [keyField]) |
Array. The array to use as a backing store.
Array. The list of display columns.
String. The name of the unique key field.
The following code creates a new Grid using an HTML <div> element with an id "grid". It creates a new ArrayModel with values from a JavaScript array called "participants". A list with columns is created and provided as the second parameter in the constructor. The key field is "index":
JavaScript Copy Code |
---|
var dv = MindFusion.DataViews; // create the grid columns var column1 = new dv.GridColumn("index"); var column2 = new dv.GridColumn("name"); // create the grid control |