DataGrid.clearAllDgRows

Syntax

clearAllDgRows();

Description

The clearAllDgRows method deletes all rows in the table rows array.

Example

To execute the example, the HTML page must contain the DataGrid named grid (see Example of Creating the DataGrid Component). Remove all rows in the array of table rows:

// Get the number of elements in the array of table rows
var length = grid.getRows().length;
console.log("Number of elements in the array of table rows: " + length);
// Remove all rows in the array of table rows
grid.clearAllDgRows();
// Get again the number of elements in the array of table rows
length = grid.getRows().length;
console.log("Number of elements in the array of table rows: " + length);

After executing the example the browser console displays length of array of table rows before and after removing of all rows:

Number of elements in the array of table rows: 10

Number of elements in the array of table rows after deleting of rows: 0

See also:

DataGrid