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
Alert box not centered in IE
22/08/2011
22:12
Avatar
triley
Ohio
Member
Members
Forum Posts: 6
Member Since:
22/08/2011
sp_UserOfflineSmall Offline

I'm fairly new to jqGrid but am starting to get the hang of things. In an application I am working on I have a jqrid displayed in a small pop-up window (approx 600 pixels wide). I noticed in IE (of course) that if you select the edit or delete icons but have not selected a row yet the alert dialog box appears positioned mostly off the screen to the right. In Firefox it seems to work fine.  After doing some unscuccesful searching around on the net I decided to look at the source code (I'm using jqGrid 4.1.2). It appears the width calculations are just falling through for IE to the default values of width=1024 and height=768. So I was able to correct this as follows:

Search for "vwidth=1024" in jquery.jqGrid.src.js and change these two lines:

    vwidth=1024;
    vheight=768;

To this:

        if (document.body && document.body.offsetWidth) {
            vwidth = document.body.offsetWidth;
            vheight = document.body.offsetHeight;
        }
        else if (document.compatMode=='CSS1Compat'
                && document.documentElement &&
                document.documentElement.offsetWidth) {
            vwidth = document.documentElement.offsetWidth;
            vheight = document.documentElement.offsetHeight;
        }
        else if (window.innerWidth && window.innerHeight) {
            vwidth = window.innerWidth;
            vheight = window.innerHeight;
        }
        else {
            vwidth=1024;
            vheight=768;
        }

To fix in the minified file do the following (if you want to edit it directly):

Search for "s=1024" and replace the following:

s=1024;t=768;

With this:

if(document.body&&document.body.offsetWidth){s=document.body.offsetWidth;t = document.body.offsetHeight;}else if(document.compatMode=='CSS1Compat'&&document.documentElement&&document.documentElement.offsetWidth){s=document.documentElement.offsetWidth;t=document.documentElement.offsetHeight;}else if(window.innerWidth&&window.innerHeight){s=window.innerWidth;t=window.innerHeight;}else{s=1024;t=768;}

Hopefully this (or something similar) will be incorporated in future releases of the jqGrid.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
54 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