I have a grid that has server sorting. The grid also has a sub grid. When I first expand a row in the main grid, my initrowdetails function is called. That adds an element to the nestedGrids array just like in the nested grid examples. Say I expand the first row in the main grid, index 0 is sent to initrowdetails. Both grids are virtual:true and pull data from the server.
sort function for main grid:
sort: function () {
$("#jqxgrid").jqxGrid('updatebounddata', 'sort');
}
The issue I have is when I sort the main grid, the records are reordered and if I expand the new first record in the main grid, initrowdetails is NOT called again. The row details from the OLD first record are then redisplayed.
beginning of the initrowdetails function:
var initrowdetails = function (index, parentElement, gridElement, record) {
var id = record.uid.toString();
var grid = $($(parentElement).children()[0]);
nestedGrids[index] = grid;
Is there a way to “reset” the rowdetails after sorting? I do NOT have this issue when filtering. If I filter and expand a row at an index previously expanded the initrowdetails is called again and I get the correct rowdetails.
As I side note, when I sort with the rowdetails expanded, they do not disappear. But I can get around that by keeping track of expanded rows and calling the hiderowdetails if needed. But again, if I filter with a row expanded, it gets hidden when the data is refreshed.
Thanks,
Mike