views:

76

answers:

0

Hello,

I am using the JqGrid-subGrid option in my MVC project to get a nested gridview look. I was able to populate data in the parent grid, i have enabled the subgrid and given the subGrid Url for poplulating innergrid data. Now the problem,subgrid is not showing up when the page is executed, not only that, the subGridUrl: method is not getting called. Can anyone help me to figure out the reason behind it? Below is my code :

jQuery(document).ready(function () {

     jQuery("#list").jqGrid({

         url: '/jqgrid/DynamicGridData/',

         datatype: 'json',

         mtype: 'GET',

         colNames: ['SurveyQnGrpId', 'SurveyQnGroup1'],

         colModel: [
              { name: 'SurveyQnGrpId', index: 'SurveyQnGrpId', width: 40, align: 'left' },

              { name: 'SurveyQnGroup1', index: 'SurveyQnGroup1', width: 400, align: 'left'}],

            pager: jQuery('#pager'),

         rowNum: 10,

         rowList: [5, 10, 20, 50],

         sortname: 'SurveyQnGrpId',

         sortorder: "SurveyQnGroup1",

         viewrecords: true,

         caption: 'My first grid',

            subGrid: true,

            subGridUrl: '/jqgrid/InnerGridData/',

         subGridModel: [
            {

                name: ['SurveyQnGrpId','SurveyQnId', 'SurveyQn', 'SurveyQnCategory', 'MandatoryQn','RadioOption3'],

                width: [10,10, 100, 10, 10,10],

                align: ['left', 'left', 'left', 'left'],

                params: ['SurveyQnGrpId']

            }]

     });
 });

Thanks in advance, Ancy