<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
	<title>jQuery Grid Plugin - jqGrid - Topic: Alert box not centered in IE</title>
	<link>http://www.trirand.com/blog/?page_id=393/bugs/alert-box-not-centered-in-ie</link>
	<description><![CDATA[Grid plugin]]></description>
	<generator>Simple:Press Version 5.7.5.3</generator>
	<atom:link href="http://www.trirand.com/blog/?page_id=393/bugs/alert-box-not-centered-in-ie/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>triley on Alert box not centered in IE</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/alert-box-not-centered-in-ie#p24367</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/alert-box-not-centered-in-ie#p24367</guid>
        	        	<description><![CDATA[<p>I&#39;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.&#160; After doing some unscuccesful searching around on the net I decided to look at the source code (I&#39;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:</p>
</p>
<p>Search for "vwidth=1024" in jquery.jqGrid.src.js and change these two lines:</p>
<p>&#160;&#160;&#160; vwidth=1024;<br />&#160;&#160;&#160; vheight=768;</p>
</p>
<p>To this:</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (document.body &#38;&#38; document.body.offsetWidth) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; vwidth = document.body.offsetWidth;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; vheight = document.body.offsetHeight;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; else if (document.compatMode==&#39;CSS1Compat&#39;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#38;&#38; document.documentElement &#38;&#38;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; document.documentElement.offsetWidth) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; vwidth = document.documentElement.offsetWidth;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; vheight = document.documentElement.offsetHeight;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; else if (window.innerWidth &#38;&#38; window.innerHeight) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; vwidth = window.innerWidth;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; vheight = window.innerHeight;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; else {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; vwidth=1024;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; vheight=768;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p>
</p>
<p>To fix in the minified file do the following (if you want to edit it directly):</p>
</p>
<p>Search for "s=1024" and replace the following:</p>
</p>
<p>s=1024;t=768;</p>
</p>
<p>With this:</p>
</p>
<p>if(document.body&#38;&#38;document.body.offsetWidth){s=document.body.offsetWidth;t = document.body.offsetHeight;}else if(document.compatMode==&#39;CSS1Compat&#39;&#38;&#38;document.documentElement&#38;&#38;document.documentElement.offsetWidth){s=document.documentElement.offsetWidth;t=document.documentElement.offsetHeight;}else if(window.innerWidth&#38;&#38;window.innerHeight){s=window.innerWidth;t=window.innerHeight;}else{s=1024;t=768;}</p>
</p>
<p>Hopefully this (or something similar) will be incorporated in future releases of the jqGrid.</p></p>
]]></description>
        	        	<pubDate>Mon, 22 Aug 2011 22:12:26 +0300</pubDate>
        </item>
</channel>
</rss>