Search
Grid.allowAppend Property
See Also
 






Gets or sets a value, indicating whether to show a new empty row at the bottom of the grid and a 'New row' option in the row context menu.

Namespace: MindFusion.DataViews
File: Grid.js

 Syntax

JavaScript  Copy Code

get allowAppend() {}

 Property Value

Boolean. True to show a new row, otherwise false.

 Example

The following code creates a new Grid instance and sets some of the Grid properties, including allowAppend:

JavaScript  Copy Code

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

 See Also