使用visualforce页面中的数据填充jqgrid

时间:2010-07-20 08:19:59

标签: model-view-controller jqgrid visualforce

我有一个visualforce页面,我正在使用jqgrid在此页面上显示数据。 jqgrid指向的url是一个visualforce页面(https://test.visual.force.com/apex/GridResults),它只输出JSON数据。此页面没有任何标头或html信息。

问题在于,当我运行此页面时,网格呈现列名但没有数据。 当我运行url时,它输出JSON数据。我粘贴在代码下面。

   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 })
    };

有关为什么jqgrid不会使用页面数据的任何想法?非常感谢。

1 个答案:

答案 0 :(得分:0)

您是否考虑过使用Visualforce远程处理?