Second Grid

QuestionsSecond Grid
Gustavo Lazaro asked 8 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 8 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

19 + 19 =

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?