function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
jpushpanjpushpan 

Fill jqgrid with data from visualforce page

I have a visualforce page and I am using jqgrid to display data on this page. The url that the jqgrid points to is a visualforce page(https://test.visual.force.com/apex/GridResults) which outputs only JSON data. This page does not have any header or html information.

The problem is that when I run the page with grid, the grid renders with column names but no shows no data.

The page which outputs JSON data is working correclty.  I have pasted below the code.

   jQuery("#list").jqGrid({
        url
:"https://test.visual.force.com/apex/GridResults",
        datatype
: "json",
        colNames
: [{!fieldNames}], -- property in controller  which outputs fieldnames
        colModel
: [{!colModel}], -- property in controller which outputs column definition
        rowNum
: 10,
        rowTotal
:10,
        rowList
: [20, 40, 60],
        loadonce
:true,
        mtype
:"GET",
        gridView
:true,
        pager
: '#pager',
        sortname
: 'Record ID',
        sortorder
: "desc",
        width
: 1200,
        height
: 400,
        caption
: "Accounts"
   
});  
    jQuery
("#list").jqGrid('navGrid', "#pager", { edit: true, add: true, del: false })
   
};

Any ideas on how the JSON data from the page can be consumed by the jqgrid? Help much appreciated.