In DataViewsJS, you can specify how to select the row header, rows or the individual cells.
You can specify the way in which the rows or the cells can get selected. You can choose from the following three selection modes,
Use the following steps to enable multiple selection mode in the grid.
This step assumes that you have already initialized the grid and defined the columns. See Creating a Basic Grid and Defining Columns for additional information. Specify selectionUnit and selectionMode in the code.
var dataView = new GC.DataViews.DataView(
document.getElementById('grid1'),
data,
columns,
new GC.DataViews.GridLayout({
selectionMode: 'multiple',
selectionUnit: 'cell',
rowHeight: 30,
})
);
When the allowHeaderSelect property is set to true, a selection icon is displayed in the row header area. You can use the selection icon to select a single row by clicking the check mark in the header row or you can select all the records at once by selecting the first row header of the grid. If the row is a group header, the entire group is selected.
These steps assumes that you have already initialized the grid and defined the columns. See Creating a Basic Grid and Defining Columns for additional information.
var dataView = new GC.DataViews.DataView(
document.getElementById('grid1'),
data,
columns,
new GC.DataViews.GridLayout({
allowGrouping: true,
grouping: [
{
field: 'country',
},
],
allowHeaderSelect: true,
selectionMode: 'multiple',
rowHeight: 30,
})
);
Note: If the allowHeaderSelect property is set to true, dataView ignores the selectionUnit and selectionMode setting.
Submit and view feedback for