Search
Grid.refreshRows Method
See Also
 






Repaints a range of rows.

Namespace: MindFusion.DataViews
File: Grid.js

 Syntax

JavaScript  Copy Code

function refreshRows (index, [count])

 Parameters

index

Number. The start index of the row range to repaint.

count
Optional.

Number. The length of the range.

 Example

The following code handles the click event of an HTML button and adds a new row to a Grid instance. The index of the grid is incremented with one from the max index of the current data and the grid is refreshed:

JavaScript  Copy Code

function onAddClick(sender)
{
    grid.allowEdit = true;
    grid.allowCellSelect = true;

    var data = grid.model.getRowData(grid.model.rowCount);
    var maxIndex = grid.model.getMaxKey();
    data.index = ++maxIndex;

    grid.addRow(data).then((newRow) =>
    {
        editRow = newRow;
        grid.refreshRows(newRow);
     
    });

 See Also