Forum


01:04

11/11/2010

JQGrid creates a space along the header for the scrollbar offset when a scrollbar is shown. The problem I am having is that it is not removing this when the scrollbar is not shown. Setting the offset to 0 fixes this however then if I do have a scrollbar I end up with a horizontal scrollbar as well.
Any suggestions or help would be much appreciated. Thanks.
Here is my JS:
jQuery("#fileList").jqGrid({
url: "videoupload.axd?request=getfiles&studyId=<%= Controller.StudyId %>",
datatype: "json",
colNames: ['File', 'Size', 'Date Uploaded'],
colModel: [
{ name: 'FileName', index: 'File', width: 225 },
{ name: 'FileSize', index: 'FileSize', width: 75 },
{ name: 'DateCreated', index: 'DateCreated', width: 150 }
],
viewrecords: true,
sortorder: "desc",
sortname: "id",
autoWidth: true,
width: "100%",
shrinkToFit: true
});
});
19:51

11/11/2010

Alright so I had to write a bit of a hack to make this work. I really don't like it so I would definitely appreciate other suggestions.
jQuery("#fileList").jqGrid({
url: "videoupload.axd?request=getfiles&studyId=<%= Controller.StudyId %>",
datatype: "json",
colNames: ['File', 'Size', 'Date Uploaded'],
colModel: [
{ name: 'FileName', index: 'File', width: 225 },
{ name: 'FileSize', index: 'FileSize', width: 75 },
{ name: 'DateCreated', index: 'DateCreated', width: 150 }
],
viewrecords: true,
sortorder: "desc",
sortname: "id",
height: 177,
shrinkToFit: false,
loadComplete: function() { adjustGridLayout(); }
});
});
function adjustGridLayout() {
var r = jQuery("#fileList").getGridParam('reccount');
if (r <= 8) {
jQuery("#fileList").setGridWidth(450, false);
}
else {
jQuery("#fileList").setGridWidth(450, true);
}
}
Most Users Ever Online: 715
Currently Online:
56 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66