<?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: Form Edit Dialog Position Relative to Viewport?</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/form-edit-dialog-position-relative-to-viewport</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/help/form-edit-dialog-position-relative-to-viewport/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>Greg Sewell on Form Edit Dialog Position Relative to Viewport?</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/form-edit-dialog-position-relative-to-viewport#p21934</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/form-edit-dialog-position-relative-to-viewport#p21934</guid>
        	        	<description><![CDATA[</p>
<p>Well I found a solution which mostly works. The only remaining problem is the  error message dialog. For that I edited jqgridmin.js to reduce the divisor on  the top .css property form 2 to 1.5 to move it down the page. It&#39;s still not  relative to the viewport</p>
</p>
<p>For the edit dialogs&#160;I used the set of functions found at <a href="http://www.softcomplex.com/docs/get_window_size_and_scrollbar_position.html&#160;in" rel="nofollow" target="_blank"><a href="http://www.softcomplex.com/doc" rel="nofollow">http://www.softcomplex.com/doc</a>.....ml&#160;in</a>  order to find the current scroll and add padding in the beforeShowForm event.  Here&#39;s the beforeShowForm:</p>
</p>
<p align="left">beforeShowForm: <strong>function</strong>(form){</p>
<p align="left"><strong>var</strong> dlgDiv =  jQuery("#editmodgrid");</p>
<p align="left">windowVertSize = f_clientHeight()</p>
<p align="left">windowVertScroll = f_scrollTop()</p>
<p align="left">topSpacing = windowVertScroll + 20</p>
<p align="left">dlgDiv[0].style.left = "25%";</p>
<p align="left">dlgDiv[0].style.top = topSpacing  + "px";</p>
<p align="left">dlgDiv[0].style.left = "25%";</p>
<p>},</p>
</p>
<p>Works fine so far in IE6 - unfortunately that&#39;smy target environment</p>
]]></description>
        	        	<pubDate>Fri, 04 Feb 2011 02:34:20 +0200</pubDate>
        </item>
        <item>
        	<title>Greg Sewell on Form Edit Dialog Position Relative to Viewport?</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/form-edit-dialog-position-relative-to-viewport#p21772</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/form-edit-dialog-position-relative-to-viewport#p21772</guid>
        	        	<description><![CDATA[<p>Hello all. First of all I&#39;d like to add my thanks for the excellent tool that has been made available here. It&#39;s been helping me out a lot.</p>
<p>Here&#39;s my issue&#160; - I have a grid where I am using form editing and I&#39;m trying to make the edit form appear in a poition relative to the top of the viewing area as opposed to the top of the current window. In other words if the window has been scrolled down I want the dialog to appear a specified distance from the top of the current viewing area instead of what I have now which seems to be a fixed distance from the top of the currently loaded page. I managed to do this with a jQuery dialog outside of the grid but I can&#39;t get the grid dialogs to work in this way. Maybe the feature isn&#39;t implemented in this way? Or maybe I need to write a custom edit dialog instead of using the default functionality from the navigator? Any help would be appreciated. Here is the JS Header code. The positionTest jQuery dialog is working the way I want it to. Unfortunately I am stuck using IE6 in the working environment which may also be part of the problem.</p>
</p>
<p>function returnToFront(){<br />&#160;&#160; &#160;var newURL = "/" + document.forms[0].DBPath.value + "/frontPage?OpenForm"&#160;&#160; &#160;<br />&#160;&#160; &#160;window.location = newURL<br />}<br />function checkQueue(val, colName){<br />&#160;&#160;&#160; var qPatt = /BK\d\d\d\d/<br />&#160;&#160;&#160; if (!qPatt.test(val)) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; return [false, "Queue Name must be entered as BKxxxx where xxxx is 4 numbers"];<br />&#160;&#160;&#160; }<br />&#160;&#160;&#160; else {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; return [true, ""];<br />&#160;&#160;&#160; }<br />}<br />function openDialog(){<br />jQuery("#positionTest").dialog("open");<br />}</p>
<p>jQuery(document).ready(function(){<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;var lastIdSel<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; jQuery(&#39;#grid&#39;).jqGrid({<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; url:"/" + document.forms[0].DBPath.value +&#39;/PullCollectorCodes?OpenAgent&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; editurl:"/" + document.forms[0].DBPath.value +&#39;/UpdateCollectorCodes?OpenAgent&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; datatype:&#39;xml&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; mtype:&#39;POST&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; altRows:true,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; height:&#39;auto&#39;, <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; rowNum:-1,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;toppager:true, <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; pager:&#39;#gridfooter&#39; ,pgbuttons:false, pginput:false,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;<br />&#160;</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; colNames:[&#39;Start&#39;,&#39;End&#39;, &#39;EmpID&#39;, &#39;Pre LCR 7&#39;, &#39;Pre LCR 11,12,13&#39;, &#39;LCR 7&#39;, &#39;LCR 11,12,13&#39;],<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; colModel:[{<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;name:&#39;ssnStart&#39;,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;width:40, <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;index:&#39;ssnStart&#39;,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;editable:true,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;editoptions: {maxlength:2},<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;editrules:{required:true, number:true}<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; },{&#160;&#160;&#160; name:&#39;ssnEnd&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; width:40, <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;index:&#39;ssnEnd&#39;,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;editable:true&#160;&#160; &#160;, <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;editoptions: {maxlength:2},<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;editrules:{required:true, number:true}<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }, {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; name:&#39;employee&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; width:80, <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;index:"employee",<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;editable:true,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;edittype:&#39;select&#39;,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;editoptions:{dataUrl:"/" + document.forms[0].DBPath.value + "/agtBuildCollectorPicklist?OpenAgent"},<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;search:true, <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;stype:&#39;select&#39;<br />//&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;searchoptions:{defaultValue:}<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }, {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; name:&#39;preLcr7Queue&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; width:110, <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;index:"preLCR7Queue",<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;editable:true, <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;edittype:&#39;select&#39;,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;editoptions:{dataUrl:"/" + document.forms[0].DBPath.value + "/agtBuildCollectorQueuePicklist?OpenAgent&#38;QueueType=PreLCR7"}<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }, {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; name:&#39;preLcrOtherQueue&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; width:110, <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;index:"preLcrOtherQueue",<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;editable:true,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;edittype:&#39;select&#39;,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;editoptions:{dataUrl:"/" + document.forms[0].DBPath.value + "/agtBuildCollectorQueuePicklist?OpenAgent&#38;QueueType=PreLCROther"}<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }, {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; name:&#39;postLcr7Queue&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; width:110,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;index:"postLcr7Queue",<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;editable:true,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;edittype:&#39;select&#39;,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;editoptions:{dataUrl:"/" + document.forms[0].DBPath.value + "/agtBuildCollectorQueuePicklist?OpenAgent&#38;QueueType=LCR7"} <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; },{<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; name:&#39;postLcrOtherQueue&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; width:110,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;index:"postLcrOtherQueue",<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;editable:true,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;edittype:&#39;select&#39;,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;editoptions:{dataUrl:"/" + document.forms[0].DBPath.value + "/agtBuildCollectorQueuePicklist?OpenAgent&#38;QueueType=LCROTher"} <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }]<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }).navGrid(&#39;#gridfooter&#39;,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{search:false, cloneToTop:true},<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{modal:true,closeAfterAdd:true, closeAfterEdit:true, checkOnSubmit:true, top:200}, // prmAdd&#160; afterSubmit:processAddReturn<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{modal:true,closeAfterAdd:true, closeAfterEdit:true, checkOnSubmit:true, top:200}, //prmEdit<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{}, // prmDel <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{}, //prmSearch<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{} // prmView<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;)&#160;&#160; &#160;<br />&#160;&#160;&#160;&#160;&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; jQuery(&#39;#positionTest&#39;).dialog({<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; autoOpen: false,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; width: 500,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; modal: true,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; position: [35, 60],<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; draggable: false,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; buttons: {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; "Continue": function(){</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; alert("Continue Button Pressed");<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; "Cancel": function(){<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; jQuery(&#39;#positionTest&#39;).dialog("close");<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160; &#160;<br />&#160;&#160;&#160; })// end confirmation dialog<br />&#160;&#160; &#160;&#160;&#160; &#160;})</p>
<p>Here&#39;s what I am loading in the HTML header:</p>
<p>jquery-ui-1.8.5.custom.css</p>
<p>ui.jqgrid.css</p>
<p>jquery-1.4.2.min.js</p>
<p>jquery-ui-1.8.5.custom.min.js</p>
<p>grid.locale-en.js</p>
<p>js/jquery.jqGrid.min.js</p>
<p>bankruptcyUiDefault.css - this is the custom jQuery UI .css</p>
]]></description>
        	        	<pubDate>Fri, 21 Jan 2011 01:25:26 +0200</pubDate>
        </item>
</channel>
</rss>