代码之家  ›  专栏  ›  技术社区  ›  Rob Wilkerson

使用jqGrid的emptyrecords选项

  •  4
  • Rob Wilkerson  · 技术社区  · 15 年前

    emptyrecords

    var pages = <?php echo $json_encoded_array ?>;
    
    $('#oversight-sample').jqGrid({
      altRows:   true,
      autowidth: true,
      caption:   'Evaluated URLs',
      colNames:  ['Actions', 'URL', 'Fetch Date'],
      colModel:  [
        { align: 'center', name: 'actions', index: 'actions', title: false, width: 60, resizable: false, sortable: false },
        { name: 'url', index: 'url', width: 400 },
        { align: 'center', name: 'created', index: 'created', width: 125, sorttype: 'date' }
      ],
      data:         pages,
      datatype:     'local',
      emptyrecords: 'No URLs have been loaded for evaluation.',
      forceFit:     true,
      height:       'auto',
      hoverrows:    true,
      sortname:     'created',
      pager:        '#url-pager',
      viewrecords:  true
    });
    

    国际单项体育联合会记录 空记录 没有消息时要显示的消息?

    谢谢。

    2 回复  |  直到 15 年前
        1
  •  4
  •   Oleg    15 年前

    你应该验证 data 参数(的值 pages 在你的情况下)。我想价值是 null {} 而不是 [] .

    更新 :您还可以考虑将当前页的显示方式从1设置为0 the small demo .

    :当然,您可以将关于空行的文本放在表的位置上。如果你要搬走的话 height: 'auto' another demo 显示了这一点。

        2
  •  2
  •   vcuankit    13 年前

    viewrecords: true 选择。

    空记录