Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
Trouble with layout not adjusting based on scrollbar visibility
11/11/2010
01:04
Avatar
chnicola
New Member
Members
Forum Posts: 2
Member Since:
11/11/2010
sp_UserOfflineSmall Offline

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(document).ready(function() {
                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
                });
            });
15/11/2010
19:51
Avatar
chnicola
New Member
Members
Forum Posts: 2
Member Since:
11/11/2010
sp_UserOfflineSmall Offline

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(document).ready(function() {
                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);
                }
            }

Forum Timezone: Europe/Sofia

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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information