DataGrid.InsertingRows

Syntax

InsertingRows: function(sender, args);

Parameters

sender. Event source.

args. Event information.

Description

The InsertingRows event occurs on starting of inserting rows to table in asynchronous mode.

Example

To execute the example, the HTML page must contain the DataGrid named grid (see Example of Creating an Asynchronous Data Table). Set the InsertingRows event handler and add a row to the object with table data:

// Set the InsertingRows event handler
grid.InsertingRows.add(function(){ console.log("InsertingRows event");});
// Create row data
var cells = {
        "num": {
            "CellData": {
                "@FT": "10",
                "@V": 10
            }
        },
        "country": {
            "CellData": {
                "@FT": "Czech Republic",
                "@V": "Czech Republic"
            }
        },
        "popul": {
            "CellData": {
                "@FT": "10",
                "@V": 10
            }
        },
        "id": {
            "CellData": {
                "@FT": "cz",
                "@V": "cz"
            }
        }
    }
// Create a new row
var myRow = new PP.Ui.DGRow({
    // Set table
    DataGrid: grid,
    // Set data
    Cells: cells,
    // Set tow index in table
    RowIndex: 10,
    // Set row height
    RealHeight: 20
});
// Add row data to table
grid.insertRows([{
    "@I": myRow.getRowIndex(),
    DataGrid: myRow.getDataGrid(),
    RowIndex: myRow.getRowIndex(),
    Cells: cells
}]);

After executing the example the browser console displays a message about occurring the InsertingRows event:

InsertingRows event

See also:

DataGrid