<?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: Feature: set table pager width</title>
	<link>http://www.trirand.com/blog/?page_id=393/feature-request/feature-set-table-pager-width</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/feature-request/feature-set-table-pager-width/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>Klaus on Feature: set table pager width</title>
        	<link>http://www.trirand.com/blog/?page_id=393/feature-request/feature-set-table-pager-width#p16924</link>
        	<category>Feature Request</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/feature-request/feature-set-table-pager-width#p16924</guid>
        	        	<description><![CDATA[<p>I sometimes have the problem that the table pager controls overlap because the left pager cell contains many custom buttons and is displayed strange on small screen size (because each of the 3 parts gets 1/3 of the total width)</p>
<p>Here is the code to set the left pager part (used for custom buttons) to a bigger width if the screen is too small.</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit9554' value='Select Code' data-codeid='sfcode9554' /></p>
<div class='sfcode' id='sfcode9554'>added grid option:&#160; pagerButtonCellWidth: -1 (disabled)</div>
<p><input type='button' class='sfcodeselect' name='sfselectit623' value='Select Code' data-codeid='sfcode623' /></p>
<div class='sfcode' id='sfcode623'>@ setPager:<br />&#160; $(&#34;#&#34;+pgid)<br />&#160;&#160;&#160; .append(&#34;&#60;div id=&#39;&#34;+pgcnt+&#34;&#39; class=&#39;ui-pager-control&#39; role=&#39;group&#39;&#62;&#60;table cellspacing=&#39;0&#39; cellpadding=&#39;0&#39; border=&#39;0&#39; class=&#39;ui-pg-table&#39; style=&#39;width:100%;&#39; role=&#39;row&#39;&#62;&#60;tbody&#62;&#60;tr&#62;&#60;td id=&#39;&#34;+lft+&#34;&#39; align=&#39;left&#39;&#62;&#60;/td&#62;&#60;td id=&#39;&#34;+cent+&#34;&#39; align=&#39;center&#39; style=&#39;white-space:pre;&#39;&#62;&#60;/td&#62;&#60;td id=&#39;&#34;+rgt+&#34;&#39; align=&#39;right&#39;&#62;&#60;/td&#62;&#60;/tr&#62;&#60;/tbody&#62;&#60;/table&#62;&#60;/div&#62;&#34;)<br />&#160;&#160;&#160; .attr(&#34;dir&#34;,&#34;ltr&#34;); //explicit setting<br />&#160;&#160;&#160; if (-1 !== ts.p.pagerButtonCellWidth) {<br />&#160;&#160; &#160;&#160; $(&#39;#&#39;+lft).css({ minWidth: ts.p.pagerButtonCellWidth });<br />&#160;&#160;&#160; }</div>
<p><input type='button' class='sfcodeselect' name='sfselectit6856' value='Select Code' data-codeid='sfcode6856' /></p>
<div class='sfcode' id='sfcode6856'>@ setGridWidth:<br />* replace:<br />&#160;&#160;&#160; if($t.p.pager ) {$($t.p.pager).css(&#34;width&#34;,nwidth+&#34;px&#34;);}</p>
<p>-&#62; with:<br />&#160;&#160;&#160; if($t.p.pager ) {<br />&#160;&#160; &#160;&#160; $($t.p.pager).css(&#34;width&#34;,nwidth+&#34;px&#34;);<br />&#160;&#160; &#160;&#160; //this block is used to set the widths of the pager cells on resize<br />&#160;&#160; &#160;&#160; if ($t.p.pagerButtonCellWidth &#62; (nwidth/3)) { //cell too small -&#62; make the others smaller<br />&#160;&#160; &#160;&#160;&#160;&#160; $($t.p.pager+&#39;_left&#39;)<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160; .css({width: $t.p.pagerButtonCellWidth})<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; .next().next()<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160; .css({width: &#39;&#39;});<br />&#160;&#160; &#160;&#160; }<br />&#160;&#160; &#160;&#160; else if($($t.p.pager+&#39;_center&#39;).css(&#39;display&#39;) !== &#39;none&#39;) {<br />&#160;&#160; &#160;&#160;&#160;&#160; $($t.p.pager+&#39;_left, &#39;+$t.p.pager+&#39;_center, &#39;+$t.p.pager+&#39;_right&#39;)<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160; .css(&#34;width&#34;,(nwidth/3)+&#34;px&#34;);<br />&#160;&#160; &#160;&#160; }<br />&#160;&#160; &#160;&#160; else {<br />&#160;&#160; &#160;&#160;&#160;&#160; $($t.p.pager+&#39;_left, &#39;+$t.p.pager+&#39;_right&#39;)<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160; .css(&#34;width&#34;,&#39;&#39;);<br />&#160;&#160; &#160;&#160; }<br />&#160;&#160;&#160; }</p>
</div>
<p>Maybe you could integrate this feature some time.</p>
<p>Kind regards,<br />Klaus.</p>
]]></description>
        	        	<pubDate>Wed, 05 May 2010 18:17:49 +0300</pubDate>
        </item>
</channel>
</rss>