【发布时间】:2015-01-31 07:30:47
【问题描述】:
我正在开发 jquery jqgrid 插件。在这个网格中,我有 1,000,000 条带有scroll: 1 选项的记录。而且我的网格中有rowNum: 10 选项。但只有前 10 行显示在网格和垂直滚动条中丢失。在标题中,我有“从 1,000,000 显示 1-10”字符串。这意味着总数计算是正确的,但我不知道为什么缺少滚动条。谁能帮我解决这个问题?
编辑:我的 jqGrid 版本是:4.6.0。这是我的javascript代码:
$(document).ready(function() {
var colModel = [
{name: "id", width: 200, align: "center", searchoptions: {clearSearch: false}, hidden: true, hiddenlg: true},
{name: "ordernumber", width: 200, align: "center", searchoptions: {clearSearch: false}},
{name: "customer.fname", width: 200, align: "center", searchoptions: {clearSearch: false}},
{name: "customer.lname", width: 200, align: "center", searchoptions: {clearSearch: false}},
];
$("#list").jqGrid({
url: "/orders/listGrid",
datatype: "json",
mtype: "POST",
colNames: ["", "1", "2", "3"],
colModel: colModel,
pager: "#pager",
rowNum: 10,
rowList: [10, 20, 30],
viewrecords: true,
multiSort: false,
gridview: true,
autoencode: true,
shrinkToFit: false,
autowidth: true,
scroll: 1,
direction: "rtl",
height: 230,
caption: "Test",
hidegrid: false,
ajaxGridOptions: {
contentType: "application/json; charset=utf-8"
},
serializeGridData: function(data) {
return JSON.stringify(data);
},
});
});
这是我的 html 代码:
<table id="list"></table>
<div id="pager"></div>
【问题讨论】:
-
您是否在网格中明确指定了
height选项以及"auto"和"100%"以外的一些值? 例如,尝试指定height: 230,即足以显示 10 行标准文本。你能发布更多关于你做什么的信息吗?您使用哪个版本的 jqGrid?问题是否只存在于某些特定版本的 jqGrid 中? -
感谢您的回复。我会更新我的问题并添加额外的信息。感谢您的关注。