I have the following grid initialisation:
$("#jqxgrid").jqxGrid(
{
source: dataAdapter,
width: StWidth,
pageable: true,
pagesize: pagesize,
sortable: true,
filterable: true,
enabletooltips: true,
selectionmode: 'multiplerowsextended',
columnsresize: true,
columnsautoresize: true,
pagesizeoptions: ['5', '10', '20', '30'],
autoshowloadelement: false,
autoheight: true,
theme: 'energyblue',
columns: StColumns,
virtualmode: true,
rendergridrows: function (params) {
return params.data;
}
})
I am using SignalR to update data in real time. Updating the cells goes well. After deletion or insertion of a row by someone else, I would like to update the grid. So I call
$("#jqxgrid").jqxGrid({ source: dataAdapter });
My question is, is it possible to restore the previous row selection after a refresh? (Taking in to account that the current row index is not necessarily the right index after the refresh.
For example for single row selection, I can get the Id of the row:
var id = $(‘#jqxgrid’).jqxGrid(‘getrowid’, selectedRow);
But I am missing the setSelectedRowById.
And even better would be if I can maintain the whole selection.
Any suggestions would be welcome.