Second Grid

QuestionsSecond Grid
Gustavo Lazaro asked 2 years ago

Hi. How could you make the second grid enabled or not depending on the value of a column of the first grid. Thank you

1 Answers
Abu Ghufran answered 2 years ago

Step1:
You can put second grid inside a <div id="#second" style=>…</div>

Step2:
And connect onSelectRow event on first grid.
$opt["onSelectRow"] = "function(ids) { do_onselect(ids); }";
$grid->set_options($opt);

Step3:
<script>
function do_onselect(id)
{
var rd = jQuery('#list1').jqGrid('getCell', id, 'company'); // where invdate is column name
if (rd == "Google") jQuery("#second").show();
else jQuery("#second").hide();
}
where list1 is first grid id, and company is it's column to check value.

Your Answer

3 + 2 =

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 / 5. Vote count:

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

Let us improve this post!