I have the event below on my dataview to handle when values are changed in code. The problem is that when this fires the call to render() causes any existing editor to be committed. I don't want that to happen. Or at least I want to start editing the cell that was actively being edited before render() was called. Any ideas on how to keep editor from committing or reopen it?
dataView.onRowsChanged.subscribe(function (e, args) {
grid.invalidateRows(args.rows);
grid.render();
dataView.syncGridSelection(grid, true);
});
figured it out. Changed my code to this and it just updates the cell and not the grid (the _.each is the same as a for loop, it's underscore js)
dataView.onRowsChanged.subscribe(function (e, args) {
_.each(args.rows, function (row) {
grid.updateRow(row);
})
dataView.syncGridSelection(grid, true);
});
additionally if you are using the enableAddRow=true in the gridOptions then you will need to do this when a row is added so it will add the row and reenable the editor.
dataView.onRowCountChanged.subscribe(function (e, args) {
//store the active cell and editor
var activeCell = grid.getActiveCell();
var activeEditor = grid.getCellEditor();
grid.render();
grid.updateRowCount();
//make the active cell editable
if (activeEditor) {
grid.setActiveCell(activeCell.row, activeCell.cell);
grid.editActiveCell();
}
dataView.syncGridSelection(grid, true);
});