I'm trying to implement data logger using Svelte and SVAR's dynamic DataGrid.
Log data array is updated by polling REST API with a given interval (I'm using REST mockup for now).
For the first rows that fit into the screen dataProvider() function gets called by grid, updating the data, while keeping the fresh data at the top rows.
However, when visible portion of grid is full, dataProvider() is not called anymore, so to update data it's nescessary to scroll the table around and force dataProvider() to be called, thus updating the data.
Is there any way to forcefully update DataGrid, or it's visible part without user interaction?
I've tried forcing the update by srolling to top position programmatically, but it seems to have no updating effect, nor scrolling effect.
function doScroll(row, column) {
gridApi.exec("scroll", { row, column });
}
// ...
const firstRowId = data[0]?.timestamp;
const firstColumnId = columns[0]?.id;
if (firstRowId && firstColumnId) {
doScroll(firstRowId, firstColumnId);
}
Demo can be found here: https://stackblitz.com/edit/vitejs-vite-axgjaf4c?file=src%2FApp.svelte
Also, is there any other simple libraries with Svelte bindings that may help me to achieve the same result? Dynamic data loading is nescessary, as logs can easily exceed 100k+ lines