Grid - complex row navigation

I have a grid in an iframe. When the user clicks a row, I am hiding that current iframe, and opening a new iframe on top of the old one with a detail view of that row. I am trying to add navigation buttons to the detail screen that make javascript calls back to the hidden source iframe screen with the grid to figure out what is the new primary key to load. The detail iframe then makes an ajax call with the new primary key to fetch data to rebind and display within that existing detail iframe.

I’ve got basic ‘next’ navigation working but still lots of issues. ‘First’ and ‘Previous’ are easy. ‘Next’ bombs when I get to the end of the virtuall loaded data. Haven’t gotten to ‘Last’ yet.

  1. I see there’s a moveRowDown method. Doesn’t seem to do anything (maybe because iframe is hidden?). Doesn’t return a true or false. After calling this, if it worked, how do I get the new current row index? Because of this, I’ve started tracking currentRowIndex myself, seeded when the user first clicks a row in the grid to drilldown.

  2. In my moveNext function, I tried calling mygrid.selectRow but this crashes, I assume because the grid’s iframe is now hidden? So for now, I just increment my currentRowIndex, then grab the pkey cell. mygrid.selectRow does work when the user clicks the grid the very first time and it’s visible.

  3. I have smartRendering enabled. So getRowsNum is returning the true total count, even though all the rows are not loaded. I don’t see a way to fetch the number of partially loaded rows or get the grid to load more rows. So I crash when I try to fetch past the end of what’s been loaded. Is there a way for me to be able to get the grid to move to the next possible row AND load on demand what’s needed? However, I assume with the ajax nature of loadondemand I’ll then need some type of callback since my detail’s screen next button needs to wait for the hidden grid to load the next group of rows.

  4. Is there any callback way that I can ask the grid to move to the next row, and then call a function of mine when that row is ready? If the row is already loaded, then it will just basically turn right around and call my function. If not and smart rendering is enabled, it will load more rows, then move to the first of the new rows, and then finally call my function. And way this will work with the grid being in a hidden iframe?

So I’ve fixed a lot of my issues by no longer setting the grid’s iframe to display:none and instead now just move it way off to the right, off the visible screen (overflow is hidden).

One nice side effect now that I notice is that I can call mygrid.selectRow and I see that before I get to the end of the loaded rows, it’s making a call to load more data. So next works quite nicely and I’m able to use ‘next’ to get to the very end.

The only thing that does not work is last, if all the rows have not yet been loaded.

Any suggested tricks for making this work?

Unfortunately the issue cannot be reconstructed locally.
The following code works well for us:

var row=mygrid.getRowIndex(mygrid.getSelectedRowId()); mygrid.selectRow(row+1,true,false,true);

if issue still occurs - please, provide with a complete demo or a demoi link, where the issue can be reproduced.