I have a jQuery grid with data with user data. I need to handle the click on grid row for each grid row when I click I need to display other grid in the bottom of the grid.
Some thing like very similar to this:
http://www.trirand.com/blog/jqgrid/jqgrid.html
Go to Advanced ---> master details
Thanks
the onSelectRow is what is making the details grid load the information from the master grid.
onSelectRow: function(ids) {
if(ids == null) {
ids=0;
if(jQuery("#list10_d").jqGrid('getGridParam','records') >0 )
{
jQuery("#list10_d").jqGrid('setGridParam',{url:"subgrid.php?q=1&id="+ids,page:1});
jQuery("#list10_d").jqGrid('setCaption',"Invoice Detail: "+ids)
.trigger('reloadGrid');
}
} else {
jQuery("#list10_d").jqGrid('setGridParam',{url:"subgrid.php?q=1&id="+ids,page:1});
jQuery("#list10_d").jqGrid('setCaption',"Invoice Detail: "+ids)
.trigger('reloadGrid');
}
}
This is how you use it
$("#tablename tr").click(function(){//do what needs to be done});
HTH
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With