views:

54

answers:

1

I have to get value from Jqgrid Selected row and populate one more grid with datas based on the selected value from the master grid. I dont want to use master detail or subgrdi in Jqgrid. Since I am using MVC, is there any way to populate the second jqgrid in one more view? I am not able to get the column value on selected row to post it to the second grid.

here is my code

$(document).ready(function() {   

        $("#UBSImageList").jqGrid({

            url: '<%= Url.Content("~/UpdateBatchStatus/UBSDataJson/") %>',   
            datatype: "json",
            mtype: 'POST',
            colNames: ['BatchImageName'],
            colModel: [
                        {name:'BatchImageName', index:'BatchImageName', align: 'left', width: 40, editable: false ,sortable: true}
                      ],
            rowNum: 20,
            rowList: [10, 20, 30, 50],
            pager: jQuery('#UBSImagePager'),
            viewrecords: true,
            imgpath: '<%= Url.Content("~/Content/Scripts/themes/basic/images")%>', 
            sortname: 'BatchImageName',
            sortorder: "asc",
            autowidth: true,
            caption: 'Client Payor Group',
            height: 350
        }); 


        $('#UBSImageList').setGridParam({
        onSelectRow: function(id) {                   
       window.location = '/UpdateBatchStatus/Details?id=' + id;    
        }
        });

}
A: 

You can get rows on server with the following code. From here you can check how to populate the second jqgrid.


$(document).ready(function(){ var grid = jQuery("#Jqgrid1"); jQuery("#m1").click( function() { var s; var rowcells=new Array(); s = grid.getGridParam('selarrrow'); //alert(s); if(s.length) { for(var i=0;i

Get Selected rows

NEW2JQ