View Record on a hidden grid

QuestionsView Record on a hidden grid
Don Mangold asked 5 years ago

I have a master/detail set of grids and want to hide the detail (in a certain situation) grid and show the record view of the first row of the detail grid. Is there a way to do this?

Thanks

1 Answers
Abu Ghufran answered 5 years ago

Hello,

I reviewed your query but currently it is not supported as a function, work around could be …

You can hide whole grid, but moving it inside <div style='display:none'> … </div>

With onselectrow of master grid, it will auto refresh hidden detail grid.

On detail grid load, you can call a js code, that will check if first row is there, select that row and invoke click of view record button.

Code:

For detail grid, set:

$opt["loadComplete"] = "function(ids){ show_first_view(ids); }";
$grid->set_options($opt);

And in script tag of html,

function show_first_view(ids)
{
var grid = $("#list2");
if(ids.rows.length > 0) {
grid.jqGrid("setSelection", ids.rows[0]);
$("#view_list2").click();
}
}

Your Answer

11 + 7 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?