<?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: setGridWidth in loadComplete when no data in grid</title>
	<link>http://www.trirand.com/blog/?page_id=393/bugs/setgridwidth-in-loadcomplete-when-no-data-in-grid</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/setgridwidth-in-loadcomplete-when-no-data-in-grid/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tony on setGridWidth in loadComplete when no data in grid</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/setgridwidth-in-loadcomplete-when-no-data-in-grid#p11027</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/setgridwidth-in-loadcomplete-when-no-data-in-grid#p11027</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Thanks. The bug is fixed in the upcomming 3.6 release.</p>
<p>Best Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Fri, 23 Oct 2009 10:39:49 +0300</pubDate>
        </item>
        <item>
        	<title>HoSpiTaL_gHoSt on setGridWidth in loadComplete when no data in grid</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/setgridwidth-in-loadcomplete-when-no-data-in-grid#p10984</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/setgridwidth-in-loadcomplete-when-no-data-in-grid#p10984</guid>
        	        	<description><![CDATA[<p>This is of course a working solution, even though the columns don&#39;t get stretched if the grid is empty, but that&#39;s not a big problem:</p>
</p>
<p>function checkTotalColumnWidth(){<br />&#160;&#160;&#160; &#160;&#160;&#160; var totalColumnWidth = $(&#39;#Grid&#39;).width();<br />&#160;&#160;&#160; &#160;&#160;&#160; var gridWidth = $(&#39;#Grid&#39;).getGridParam("width");<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; <br />&#160;&#160;&#160; &#160;&#160;&#160;&#160; if(totalColumnWidth !=0 &#38;&#38; totalColumnWidth &#60; gridWidth){<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160; if ($(&#39;#Grid&#39;).getGridParam(&#39;records&#39;) &#62; 0) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160; &#160; &#160; &#160; $(&#39;#Grid&#39;).setGridWidth(gridWidth + 0.01, true);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160; &#160;&#160;&#160; }<br />}</p>
</p>
<p>But the problem I mentioned is a bug nevertheless, I think.</p>
]]></description>
        	        	<pubDate>Thu, 22 Oct 2009 07:01:10 +0300</pubDate>
        </item>
        <item>
        	<title>HoSpiTaL_gHoSt on setGridWidth in loadComplete when no data in grid</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/setgridwidth-in-loadcomplete-when-no-data-in-grid#p10983</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/setgridwidth-in-loadcomplete-when-no-data-in-grid#p10983</guid>
        	        	<description><![CDATA[<p>I use jqgrid 3.5.3 and I wrote the following Javascript function which gets executed in loadComplete:</p>
</p>
<p>function checkTotalColumnWidth(){<br />&#160;&#160;&#160; &#160;&#160; var totalColumnWidth = $(&#39;#Grid&#39;).width();<br />&#160;&#160;&#160; &#160;&#160; var gridWidth = $(&#39;#Grid&#39;).getGridParam(&#8221;width&#8221;);<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; <br />&#160;&#160;&#160; &#160;&#160; if(totalColumnWidth !=0 &#38;&#38; totalColumnWidth &#60; gridWidth){<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; $(&#39;#Grid&#39;).setGridWidth(gridWidth+0.01,true);<br />&#160;&#160;&#160; &#160;&#160; }<br />}</p>
</p>
<p>This goal of this function is to stretch the columns to fit the width of the grid, ONLY if the total width of all the columns is less than the width of the grid. When the total column width is greater than the width of the grid, it shows a horizontal scrollbar.</p>
<p>This function works perfectly when the grid has data, but when the grid is empty and totalColumnWidth &#60; gridWidth, the following Javascript error appears on line $(&#39;#Grid&#39;).setGridWidth(gridWidth+0.01,true) :</p>
</p>
<div class="errorTitle focusRow subLogRow">$t.grid.cols[lvc] is undefined:</div>
<div class="errorSourceBox errorSource-exec focusRow subLogRow">[Image Can Not Be Found]<a class="errorSource a11yFocus" target="_blank">$t.grid.cols[lvc].style.width = cw + &#8220;px&#8221;\\n</a></div>
<div class="errorSourceBox errorSource-exec focusRow subLogRow"></div>
<div class="errorSourceBox errorSource-exec focusRow subLogRow">The result of this is that the &#8220;Loading&#8230;&#8221; message appears on the grid and doesn&#39;t disappear, because there was a javascript error.</div>
<div class="errorSourceBox errorSource-exec focusRow subLogRow">Is there a way I can resolve this problem?</div>
<div class="errorSourceBox errorSource-exec focusRow subLogRow"></div>
<div class="errorSourceBox errorSource-exec focusRow subLogRow">EDIT: this problem occurs in Firefox and Chrome, not in IE.</div>
<div class="errorSourceBox errorSource-exec focusRow subLogRow"></div>
<div class="errorSourceBox errorSource-exec focusRow subLogRow">Thanks in advance!</div>
]]></description>
        	        	<pubDate>Thu, 22 Oct 2009 06:06:50 +0300</pubDate>
        </item>
</channel>
</rss>