0

I am using jqGrid 4.4.1. I am populating jqGrid locally in my js file with JSON objects.

var $myGrid = $('#myTable');

function initializeGrid(data) {
 $myGrid.jqGrid({
   data:data,
   datatype: "local",
   . . . 
   . . .
   caption : 'Title'
 });
}

I am calling this function as callback of ajax call which will input JSON data to this function. The grid is populating properly, but Caption is not coming. I am not even able to see title bar on jqGrid.

I have tried set caption manually using following command on chrome console, but still its not working.

$myGrid.jqGrid('setGridParam','caption','Title');

Do I need to do any specific configuration for this?

Pankaj
  • 97
  • 2
  • 9

2 Answers2

0

this works for me .try this

  jQuery("##myTable").jqGrid({

            url: '.....'
            datatype: 'json',
            mtype: 'POST',
            postData: {
                documentUserLinkString: '@Model.documentUserLinkString'
            },

            // Paging
            toppager: false,
            pager: $("#ReciverNamepager"),
            rowNum: 15,
            gridview: true,

            // Default sorting
            sortname: "FullName",
            sortorder: "asc",
            gridComplete: CheckEmptyData,
            emptyrecords: 'File is not yet shared',
            emptyDataText: '<div class="errordiv">File is not yet shared</div>',

            caption: "File Reciver Name List"//  this is 
        }).navGrid({ edit: false, add: false, del: false, refresh: true, search: false });

    });
Jack
  • 130
  • 4
  • 16
0

I have found the cause for this problem. There was a line in one of my css which was causing this

.ui-jqgrid-title{ visibility:hidden}

Thanks for the answers !

Pankaj
  • 97
  • 2
  • 9