[GRID] Make certain row opened initially (with pagination)

I am using sub_row_ajax and would like to open one of rows (identified by id) initially…



The following code doesn’t work… I suspect that it is triggered a little bit to early (before rows were actually rendered). Can You tell me how to fix it?



<% if options[:open_node] %>

grid_<%=random_id%>.attachEvent(“onXLE”,function(id){

grid_<%=random_id%>.collapsMonolite();

grid
<%=random_id%>.cells(’<%= options[:open_node] %>’,0).open();

grid_<%=random_id%>.setSizes();

return true;

});

<% end %>



The second question is : Will it work if pagination is on? Will it automatically move to proper page, and open required row? It would be nice if it does…

Will it automatically move to proper page, and open required row
It will not work in such manner but can be easily updated to do such task

grid_.attachEvent(“onXLE”,function(id){

    grid_.collapsMonolite();

    grid
.getRowById(some);   //will parse row if it still in buffer
    grid_.showRow(some); // will switch grid to necessary page and set scrollbar so row will be visible
    grid_.cells(‘some’,0).open();

    grid_.setSizes();

    return true;

});



>>I suspect that it is triggered a little bit to early
Actually the onXLE  called when data loaded for sure, but in case of paging or smart rendering the row may stay not parsed in buffer, which may cause error during cells operation.
To be sure that row parsed you can use code provided in sample above