0

如果我将 gridView 属性设置为 true,则表格高度设置不正确,它在最后一条记录下方显示空白空间。我认为它正在完成最后一页的 rowNum。是错误还是我缺少要设置的属性?这只发生在 FireFox

 $('#jqgInventory').jqGrid({
autowidth: true,
caption: 'Inventory',
datatype:'local',
forceFit: true,
gridview: true,
height: 500,
hidegrid: false,
ignoreCase: true,
loadonce: true,
loadui: 'disable',
rowNum:25,
scroll:true,
shrinkToFit: true,
viewrecords: true,
beforeRequest: function() {$('#gridScript').block();},
beforeSelectRow: function(rowid, e) {return false;},
gridComplete: function() {$('#lblVehicleCount').html($('#jqgInventory').getGridParam('records'));$('#gridScript').unblock();Inventory.modifyGridCellClick();},
colModel: [
{
align: 'Center',
name:'Select',
label: 'SEL',
title: true,
width:20,
index:'Select'
},{
align: 'Left',
name:'Photo',
hidden: false,
label: 'PHOTO',
stype:'text',
sortable: false,
sorttype:'text',
title: true,
width:100,
index:'Photo'
},{
align: 'Left',
name:'Information',
hidden: false,
label: 'INFO',
stype:'text',
sortable: false,
sorttype:'text',
title: true,
width:100,
index:'Information'
},{
align: 'Right',
name:'Price',
hidden: false,
label: 'PRICE',
stype:'text',
sortable: true,
sorttype:function(cellValue){return CustomGridSortByIntegerAsString(cellValue);},
title: true,
width:50,
index:'Price'
},{
align: 'Right',
name:'Mileage',
hidden: false,
label: 'MILEAGE',
stype:'text',
sortable: true,
sorttype:function(cellValue){return CustomGridSortByIntegerAsString(cellValue);},
title: true,
width:25,
index:'Mileage'
},{
align: 'Right',
name:'Age',
hidden: false,
label: 'AGE',
stype:'text',
sortable: true,
sorttype:function(cellValue){return CustomGridSortByIntegerAsString(cellValue);},
title: true,
width:50,
index:'Age'
},{
name:'VehicleKey',
hidden: true,
label: 'VEHICLEKEY',
width:50,
index:'VehicleKey'
}
]
,data:data});

在此处输入图像描述

4

1 回答 1

1

首先你应该小心使用字母的大小写。不gridview: true一样。gridView: true以同样的方式,你应该使用datatype: 'local'代替datatype: 'Local'loadui: 'disable'代替loadui: 'Disable'。如果你写得正确,loadui你可以删除beforeRequest你使用的值。

要解决您的主要问题,您应该使用height: 'auto'(或height: '100%')或添加附加选项scrollOffset: 0

于 2012-05-01T15:56:16.540 回答