【问题标题】:Caption not appearing for jqGridjqGrid 没有出现标题
【发布时间】:2014-08-29 10:01:04
【问题描述】:

我正在使用 jqGrid 4.4.1。我正在使用 JSON 对象在我的 js 文件中本地填充 jqGrid。

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

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

我将此函数称为 ajax 调用的回调,它将向该函数输入 JSON 数据。网格填充正确,但标题没有出现。我什至看不到 jqGrid 上的标题栏。

我尝试在 chrome 控制台上使用以下命令手动设置标题,但仍然无法正常工作。

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

我需要为此做任何特定的配置吗?

【问题讨论】:

标签: jquery jqgrid


【解决方案1】:

这对我有用。试试这个

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

    });

【讨论】:

    【解决方案2】:

    我已经找到了这个问题的原因。我的一个 css 中有一行导致此问题

    .ui-jqgrid-title{ visibility:hidden}
    

    感谢您的回答!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-03-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-03-26
      • 2016-09-21
      • 1970-01-01
      • 2016-10-18
      相关资源
      最近更新 更多