<?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: For those looking to print a jqGrid grid.</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/for-those-looking-to-print-a-jqgrid-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/help/for-those-looking-to-print-a-jqgrid-grid/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>gushendra86 on For those looking to print a jqGrid grid.</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/for-those-looking-to-print-a-jqgrid-grid#p29171</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/for-those-looking-to-print-a-jqgrid-grid#p29171</guid>
        	        	<description><![CDATA[<p>Hai macrabbit, my code is just like this 🙂</p>
</p>
<p>// setup grid print capability. Add print button to navigation bar and bind to click.<br />function setPrintGrid(gid,pid,pgTitle){<br />&#160; // print button title.<br />&#160; var btnTitle = &#39;Print Grid&#39;;</p>
<p>&#160; // setup print button in the grid top navigation bar.<br />&#160; $(&#39;#&#39;+gid).jqGrid(&#39;navSeparatorAdd&#39;,&#39;#&#39;+gid+&#39;_toppager_left&#39;, {sepclass :&#39;ui-separator&#39;});<br />&#160; $(&#39;#&#39;+gid).jqGrid(&#39;navButtonAdd&#39;,&#39;#&#39;+gid+&#39;_toppager_left&#39;, {caption: &#39;&#39;, title: btnTitle, position: &#39;last&#39;, buttonicon: &#39;ui-icon-print&#39;, onClickButton: function() {PrintGrid();} });</p>
<p>&#160; // setup print button in the grid bottom navigation bar.<br />&#160; $(&#39;#&#39;+gid).jqGrid(&#39;navSeparatorAdd&#39;,&#39;#&#39;+pid, {sepclass : "ui-separator"});<br />&#160; $(&#39;#&#39;+gid).jqGrid(&#39;navButtonAdd&#39;,&#39;#&#39;+pid, {caption: &#39;&#39;, title: btnTitle, position: &#39;last&#39;, buttonicon: &#39;ui-icon-print&#39;, onClickButton: function() { PrintGrid();} });</p>
<p>&#160; function PrintGrid(){<br />&#160;&#160; // empty the print div container.<br />&#160;&#160; $(&#39;#prt-container&#39;).empty();</p>
<p>&#160;&#160; // copy and append grid view to print div container.<br />&#160;&#160; $(&#39;#prt-container&#39;).append(&#39;&#60;img src="../img_logo/33logo.png" display="table"&#62;&#39;);<br />&#160;&#160; $(&#39;#gview_&#39;+gid).clone().appendTo(&#39;#prt-container&#39;).css({&#39;page-break-after&#39;:&#39;auto&#39;});</p>
<p>&#160;&#160; // remove navigation divs.<br />&#160;&#160; $(&#39;#prt-container div&#39;).remove(&#39;.ui-jqgrid-toppager,.ui-jqgrid-titlebar,.ui-userdata,#jqgh_grid_act,#jqgh_grid_cb,.s-ico,.ui-jqgrid-pager&#39;);<br />&#160; &#160;<br />&#160;&#160; $(&#39;#prt-container div .cbox&#39;).remove();<br />&#160;&#160; $(&#39;#prt-container div input&#39;).remove();</p>
<p>&#160;&#160; // print the contents of the print container.<br />&#160;&#160; $(&#39;#prt-container&#39;).printElement({pageTitle:pgTitle, overrideElementCSS:[{ href:&#39;css/print-grid.css&#39;,media:&#39;print&#39;}]});<br />&#160;&#160; $(&#39;#prt-container&#39;).empty();<br />&#160; }<br />}<br />// setup grid print capability. Add print button to navigation bar and bind to click.<br />setPrintGrid(&#39;grid&#39;,&#39;paging&#39;,&#39;Admin Page&#39;);</p>
</p>
<p>Hope you success too <img class="spSmiley" style="margin:0" title="Smile" src="/blog/wp-content/forum-smileys/sf-smile.gif" alt="Smile" /></p>
]]></description>
        	        	<pubDate>Mon, 15 Jul 2013 03:57:48 +0300</pubDate>
        </item>
        <item>
        	<title>macrabbit on For those looking to print a jqGrid grid.</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/for-those-looking-to-print-a-jqgrid-grid#p29166</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/for-those-looking-to-print-a-jqgrid-grid#p29166</guid>
        	        	<description><![CDATA[<p>Hi, I got the same issue with you . I found that the "&#60;div id="prt-container" &#62;&#60;/div&#62;" was not hidden . But if i add the css as like&#160;</p>
<p>"&#60;div id="prt-container" &#160;style="display: none;"&#62;&#60;/div&#62;" &#160;, will be solved the issuse. But the grid contain could not show on the print page .</p>
<p>Can you help me too?</p>
<p>Thanks</p></p>
]]></description>
        	        	<pubDate>Fri, 12 Jul 2013 21:16:29 +0300</pubDate>
        </item>
        <item>
        	<title>gushendra86 on For those looking to print a jqGrid grid.</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/for-those-looking-to-print-a-jqgrid-grid#p29161</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/for-those-looking-to-print-a-jqgrid-grid#p29161</guid>
        	        	<description><![CDATA[<p>hai, it&#39;s done. I just add</p>
<p>$(&#39;#prt-container&#39;).empty();</p>
<p>after</p>
<p>$(&#39;#prt-container&#39;).printElement({pageTitle:pgTitle, overrideElementCSS:[{ href:&#39;css/print-grid.css&#39;,media:&#39;print&#39;}]});</p>
</p>
<p>Anyway, 1 more problem is when i click print, it does not print a div with background color ? Any solution ?</p>
</p>
<p>This is my code :</p>
</p>
<p>&#60;script type="text/javascript" src="jquery.js"&#62;&#60;/script&#62;<br />&#60;script type="text/javascript" src="jquery.printElement.js"&#62;&#60;/script&#62;<br />&#60;script type="text/javascript"&#62;<br />function PrintGrid(){<br />&#160;&#160; &#160;// empty the print div container.<br />&#160;&#160; &#160;$(&#39;#prt-container&#39;).empty();<br />&#160;&#160; &#160;<br />&#160;&#160; &#160;// copy and append grid view to print div container.<br />&#160;&#160; &#160;<br />&#160;&#160; &#160;$(&#39;#form&#39;).clone().appendTo(&#39;#prt-container&#39;).css({&#39;page-break-after&#39;:&#39;auto&#39;});<br />&#160;&#160; &#160;<br />&#160;&#160; &#160;// print the contents of the print container.<br />&#160;&#160; &#160;$(&#39;#prt-container&#39;).printElement({overrideElementCSS:[{ href:&#39;index.css&#39;,media:&#39;print&#39;}]});<br />&#160;&#160; &#160;$(&#39;#prt-container&#39;).empty();<br />}<br />&#60;/script&#62;<br />&#60;div id=&#39;prt-container&#39; class=&#39;hide&#39;&#62;<br />&#60;/div&#62;</p>
<p>&#60;div id="form"&#62;<br />&#160;&#160; &#160;&#60;a href="asd"&#62;asdasda&#60;/a&#62;<br />&#160;&#160;&#160; &#60;div id="clr"&#62;h&#60;/div&#62;<br />&#60;/div&#62;<br />&#60;div&#62;<br />test<br />&#60;/div&#62;<br />&#60;a href="#" onclick="PrintGrid();"&#62;print&#60;/a&#62;</p>
<p>and this is the css :</p>
<p>#clr {<br />background:red; width:200px; height:20px; padding:50px; color:red;<br />}</p>
</p>
<p>Many Thank you.</p>
]]></description>
        	        	<pubDate>Fri, 12 Jul 2013 11:53:32 +0300</pubDate>
        </item>
        <item>
        	<title>tony on For those looking to print a jqGrid grid.</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/for-those-looking-to-print-a-jqgrid-grid#p29136</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/for-those-looking-to-print-a-jqgrid-grid#p29136</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>It depends what you do.</p>
<p>Can you please show your code when the print icon is clicked?</p>
<p>Regards</p>
]]></description>
        	        	<pubDate>Wed, 10 Jul 2013 12:53:54 +0300</pubDate>
        </item>
        <item>
        	<title>gushendra86 on For those looking to print a jqGrid grid.</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/for-those-looking-to-print-a-jqgrid-grid#p29133</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/for-those-looking-to-print-a-jqgrid-grid#p29133</guid>
        	        	<description><![CDATA[<p>Hello, this plugins help me very much, Thanks to you first 🙂</p>
<p>I have a problem when i click the print button. It appear in the bottom of jqgrid</p>
</p>
<p>Before :</p>
<p><a href="http://www.pusatkios.com/before.jpg"><img src="http://www.pusatkios.com/before.jpg" width="100"  class="sfimageleft spUserImage" alt="before" /><img src="http://www.trirand.com/blog/wp-content/sp-resources/forum-themes/default/images/sp_Mouse.png" class="sfimageleft sfmouseleft" alt="Image Enlarger" /></a></p>
<p>After i click the button it appear :</p>
<p><a href="http://www.pusatkios.com/after.jpg"><img src="http://www.pusatkios.com/after.jpg" width="100"  class="sfimageleft spUserImage" alt="" /><img src="http://www.trirand.com/blog/wp-content/sp-resources/forum-themes/default/images/sp_Mouse.png" class="sfimageleft sfmouseleft" alt="Image Enlarger" /></a></p>
</p>
<p>Can anyone help me how not display the print after jqgrid ? Many Thanks.</p>
]]></description>
        	        	<pubDate>Wed, 10 Jul 2013 10:22:16 +0300</pubDate>
        </item>
        <item>
        	<title>JiheL on For those looking to print a jqGrid grid.</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/for-those-looking-to-print-a-jqgrid-grid#p28275</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/for-those-looking-to-print-a-jqgrid-grid#p28275</guid>
        	        	<description><![CDATA[<p>Hi Nelsomn</p>
<p>First of all many thanks for your work which will help me in app building !</p>
<p>Please can you tell me why I obtain the message &#39;a.browser is undefined&#39; from printElement.js when I click on Print button in Firefox 18.0.2 ?</p>
<p>Again, great work !</p>
<p>Cheers</p>
<p>JiheL</p>
]]></description>
        	        	<pubDate>Thu, 14 Feb 2013 13:16:30 +0200</pubDate>
        </item>
        <item>
        	<title>mah on For those looking to print a jqGrid grid.</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/for-those-looking-to-print-a-jqgrid-grid#p27483</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/for-those-looking-to-print-a-jqgrid-grid#p27483</guid>
        	        	<description><![CDATA[<p>I manage to solve the issue with the fixed footer today. Aparently was a matter of css. Im posting my solution maybe it will help others if they have similar issues. I was using jqueryui for the css of the jqgrid.</p>
</p>
<p>I put this code inside PrintGrid(), right before the code removing the navigation divs:</p>
</p>
<blockquote>
<p>&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; //Fixed footer in the last page</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $(&#39;#prt-container .ui-jqgrid-bdiv&#39;).css({ &#39;height&#39;: &#39;auto&#39; });<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;$(&#39;#prt-container .ui-jqgrid-sdiv&#39;).before($(&#39;#prt-container .ui-jqgrid-bdiv&#39;));</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // remove navigation divs.</p>
</blockquote>
<p>Besides that, I tested a little more your function and put some header in the 1st page of the printed page.</p>
<blockquote>
<p>//Insert logo as a header of the 1st page</p>
<p>$(&#39;#prt-container&#39;).append(&#39;&#60;img src="../../img/Logo1.jpg" display="table"&#62;&#39;);</p>
<p>&#160;&#160;&#160; // copy and append grid view to print div container.</p>
</blockquote>
]]></description>
        	        	<pubDate>Thu, 04 Oct 2012 20:21:12 +0300</pubDate>
        </item>
        <item>
        	<title>nelsonm on For those looking to print a jqGrid grid.</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/for-those-looking-to-print-a-jqgrid-grid#p27469</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/for-those-looking-to-print-a-jqgrid-grid#p27469</guid>
        	        	<description><![CDATA[<p>mah,</p>
<p>I can&#39;t explain why this is happening to you since i don&#39;t know how you have put together your grid.&#160; In any case, you should not have to modify any of the setPrintGrid function code.&#160; Why don&#39;t you zip and email me the file that contains your grid definition and setPrintGrid function call.&#160; I can&#39;t promise you anything, but i will take a quick look at it.</p>
]]></description>
        	        	<pubDate>Wed, 03 Oct 2012 02:21:16 +0300</pubDate>
        </item>
        <item>
        	<title>mah on For those looking to print a jqGrid grid.</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/for-those-looking-to-print-a-jqgrid-grid#p27466</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/for-those-looking-to-print-a-jqgrid-grid#p27466</guid>
        	        	<description><![CDATA[<p>Hello!</p>
</p>
<p>So still about #2, I got the footer to stay in the top of the printed page(as img below) by inserting</p>
<blockquote>
<p>$(&#39;#prt-container .ui-jqgrid-sdiv&#39;).after($(&#39;#prt-container .ui-jqgrid-bdiv&#39;));</p>
</blockquote>
<p>Right before removing the navigation divs in the function <em>PrintGrid</em>.</p>
</p>
<p><a href="http://i.imgur.com/ot7dc.png"><img src="http://i.imgur.com/ot7dc.png" width="100"  class="sfimageleft spUserImage" alt="http://i.imgur.com/ot7dc.png" /><img src="http://www.trirand.com/blog/wp-content/sp-resources/forum-themes/default/images/sp_Mouse.png" class="sfimageleft sfmouseleft" alt="Image Enlarger" /></a></p>
<p>But I still cant manage to put the footer at the end of the last line of the grid in the printing page.</p>
<p>Everything I tried, the footer overlays the other rows in the 1st page of the printing page as I showed before. <img class="spSmiley" style="margin:0" title="Cry" src="/blog/wp-content/forum-smileys/sf-cry.gif" alt="Cry" /></p>
]]></description>
        	        	<pubDate>Tue, 02 Oct 2012 21:34:20 +0300</pubDate>
        </item>
        <item>
        	<title>mah on For those looking to print a jqGrid grid.</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/for-those-looking-to-print-a-jqgrid-grid#p27451</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/for-those-looking-to-print-a-jqgrid-grid#p27451</guid>
        	        	<description><![CDATA[<p>Hi!</p>
<p>Thanks for the response!</p>
<p>#1 &#8211; I was calling setPrintGrid before loading the navgrid. Now I put the call after the navgrid(obviously lol) and it worked! <img class="wp-smiley" src="/blog/wp-includes/images/smilies/icon_smile.gif" alt=":)" /></p>
</p>
<p>#2 -Im posting the images. 1st image is the grid on the screen. It has groups and totals for each group. And then in the bottom is the global total that is fixed in the grid as a footer.</p>
<p>2nd its the print of the grid with the fixed footer overlaying the other columns . <img class="spSmiley" style="margin:0" title="Smile" src="/blog/wp-content/forum-smileys/sf-smile.gif" alt="Smile" /></p>
</p>
<p><a href="http://i.imgur.com/h5y6p.png"><img src="http://i.imgur.com/h5y6p.png" width="100"  class="sfimageleft spUserImage" alt="http://i.imgur.com/h5y6p.png" /><img src="http://www.trirand.com/blog/wp-content/sp-resources/forum-themes/default/images/sp_Mouse.png" class="sfimageleft sfmouseleft" alt="Image Enlarger" /></a></p>
<p><a href="http://i.imgur.com/Pmnyj.png"><img src="http://i.imgur.com/Pmnyj.png" width="100"  class="sfimageleft spUserImage" alt="http://i.imgur.com/Pmnyj.png" /><img src="http://www.trirand.com/blog/wp-content/sp-resources/forum-themes/default/images/sp_Mouse.png" class="sfimageleft sfmouseleft" alt="Image Enlarger" /></a></p>
]]></description>
        	        	<pubDate>Mon, 01 Oct 2012 16:40:36 +0300</pubDate>
        </item>
        <item>
        	<title>nelsonm on For those looking to print a jqGrid grid.</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/for-those-looking-to-print-a-jqgrid-grid#p27377</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/for-those-looking-to-print-a-jqgrid-grid#p27377</guid>
        	        	<description><![CDATA[<p>hi all,</p>
<p>I modified the "setPrintGrid" function a bit.&#160; You no longer have to manually define the ".hide" css or the print container div.&#160; The "setPrintGrid" function now does that for you.&#160; All you have to do is create the "print-grid.css" file.</p>
<p>I have posted the new code in a new post so this one does not go on forever.</p>
<p>thanks.</p>
]]></description>
        	        	<pubDate>Tue, 25 Sep 2012 00:49:41 +0300</pubDate>
        </item>
        <item>
        	<title>nelsonm on For those looking to print a jqGrid grid.</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/for-those-looking-to-print-a-jqgrid-grid#p27376</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/for-those-looking-to-print-a-jqgrid-grid#p27376</guid>
        	        	<description><![CDATA[<p>mah,</p>
<p>Issue #1 does not occur in my tests.&#160; make sure the <strong>"setPrintGrid</strong>" function call is placed within the document ready function that contains the grid definition.&#160; I place my <strong>"setPrintGrid</strong>" call at the bottom of the docutment ready function.</p>
<p>Also, i have updated the code a bit so you don&#39;t have to define a print container or add the ".hide" css in some css file.&#160; the new code creates these for you.&#160; all you have to do is create the "print-grid" css file.&#160; the new code is displayed in the next post.<strong><br /></strong></p>
<blockquote>
<p>$(function() {</p>
<p>// example jqGrid<br />$(&#39;#tab4-grid&#39;).jqGrid({<br />.<br />pager: &#39;#tab4-pager&#39;,<br />toppager: true, // comment out if you don&#39;t want the the top nav bar.<br />.<br />});</p>
<p>// setup grid print capability. Add print button to navigation bar and bind to click.<br /><strong>setPrintGrid(&#39;tab4-grid&#39;,&#39;tab4-pager&#39;,&#39;Customer Grid&#39;);</strong></p>
<p>});</p>
</blockquote>
<p>issue #2 - you&#39;ll have to display a screen shot of the your grid before i can help with that.</p></p>
]]></description>
        	        	<pubDate>Tue, 25 Sep 2012 00:40:33 +0300</pubDate>
        </item>
        <item>
        	<title>mah on For those looking to print a jqGrid grid.</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/for-those-looking-to-print-a-jqgrid-grid#p27375</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/for-those-looking-to-print-a-jqgrid-grid#p27375</guid>
        	        	<description><![CDATA[<p><strong>nelsonm, tyvm for the code! A really nice solution for the printing problem.<br /></strong></p>
<p><strong>But Im having 2 issues:&#160;</strong></p>
<p><strong>1. Everytime I reload the grid, a new print button is set in the navgrid.</strong></p>
<p><strong>2. I have a footer row with sums and when I print the grid the footer stays in between the grid rows and not in the end of the last page. I even tried to remove the footer from the prt-container but no sucess. </strong></p>
<p><strong>Any workarounds?&#160;<img class="spSmiley" style="margin:0" title="Confused" src="/blog/wp-content/forum-smileys/sf-confused.gif" alt="Confused" /> </strong></p>
]]></description>
        	        	<pubDate>Mon, 24 Sep 2012 23:25:53 +0300</pubDate>
        </item>
        <item>
        	<title>nelsonm on For those looking to print a jqGrid grid.</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/for-those-looking-to-print-a-jqgrid-grid#p27310</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/for-those-looking-to-print-a-jqgrid-grid#p27310</guid>
        	        	<description><![CDATA[<p>Here is the jqgrid screen.</p>
<p><a href="http://www.nados.com/public/jqgrid-screen.png"><img src="http://www.nados.com/public/jqgrid-screen.png" width="100"  class="sfimageleft spUserImage" alt="" /><img src="http://www.trirand.com/blog/wp-content/sp-resources/forum-themes/default/images/sp_Mouse.png" class="sfimageleft sfmouseleft" alt="Image Enlarger" /></a></p>
</p>
<p>Here is an image of a work order grid printout with subgrids.</p>
<p><a href="http://www.nados.com/public/jqgrid-print.png"><img src="http://www.nados.com/public/jqgrid-print.png" width="100"  class="sfimageleft spUserImage" alt="printout of grid" /><img src="http://www.trirand.com/blog/wp-content/sp-resources/forum-themes/default/images/sp_Mouse.png" class="sfimageleft sfmouseleft" alt="Image Enlarger" /></a></p></p>
]]></description>
        	        	<pubDate>Wed, 12 Sep 2012 19:49:34 +0300</pubDate>
        </item>
        <item>
        	<title>nelsonm on For those looking to print a jqGrid grid.</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/for-those-looking-to-print-a-jqgrid-grid#p27295</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/for-those-looking-to-print-a-jqgrid-grid#p27295</guid>
        	        	<description><![CDATA[<p>Also, preceding the "table, th and td" css entries in the "print-grid.css" file in the original post with "#prt-container" should eliminate any problems with the css entries interfering with other tables.</p>
]]></description>
        	        	<pubDate>Mon, 10 Sep 2012 23:21:32 +0300</pubDate>
        </item>
        <item>
        	<title>nelsonm on For those looking to print a jqGrid grid.</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/for-those-looking-to-print-a-jqgrid-grid#p27294</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/for-those-looking-to-print-a-jqgrid-grid#p27294</guid>
        	        	<description><![CDATA[<p>No problem&#8230;</p>
<p>I&#39;m sure someone can probably streamline the process a bit and make it a little more flexable.</p>
</p>
<p>On a side note&#8230;</p>
<p>I realized that the "print-grid.css" file should not contain the ".hide" css entry.&#160; The ".hide" css entry should be put in a css file that is defined in the head of the index page.&#160; Also, the "print-grid.css" file should NOT be defined on the index or any other page.&#160; It should just exist in the css folder of the site and be called from the "printElement" plugin.</p>
<p>Defining "print-grid.css" in the head of the index or any other page would interfere with other tables.</p>
</p>
<p>Sorry about that.</p>
]]></description>
        	        	<pubDate>Mon, 10 Sep 2012 19:55:18 +0300</pubDate>
        </item>
        <item>
        	<title>tony on For those looking to print a jqGrid grid.</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/for-those-looking-to-print-a-jqgrid-grid#p27282</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/for-those-looking-to-print-a-jqgrid-grid#p27282</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>I do not have time to test this,</p>
<p>but Thank youfor sharing your solution.</p>
</p>
<p>Kind Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Mon, 10 Sep 2012 18:47:27 +0300</pubDate>
        </item>
        <item>
        	<title>nelsonm on For those looking to print a jqGrid grid.</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/for-those-looking-to-print-a-jqgrid-grid#p27272</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/for-those-looking-to-print-a-jqgrid-grid#p27272</guid>
        	        	<description><![CDATA[<p>Hi all,</p>
<p>For those who want to be able to print a jqGrid grid, i&#39;d like to offer a nice solution. Even though you only have to specify the main grid id, any sub grids nested within the main grid print out nicely as well. All of this is done on the client side in javascript.</p>
<p>The function adds a print button to the end of the standard jqGrid buttons on the left side of the navigation bar and binds the button to the print function on click. The function uses jQuery and jqGrid methods as well as the third party "printElement" plugin to accomplish the task.</p>
<p>0. download and install Erik Zaadi&#39;s "printElement" plugin at: <a rel="nofollow" href="http://projects.erikzaadi.com/jQueryPlugins/jQuery.printElement/" target="_blank"></a><a href="http://projects.erikzaadi.com/&#038;hellip" rel="nofollow" target="_blank"><a href="http://projects.erikzaadi.com/" rel="nofollow">http://projects.erikzaadi.com/</a>.....038;hellip</a>;..ntElement/ .</p>
<p>1. create a div container somewhere.</p>
<blockquote>
<p>&#60;div id=&#39;prt-container&#39; class=&#39;hide&#39;&#62;<br />&#60;/div&#62;</p>
</blockquote>
<p>2. create a "print-grid.css" file that contains entries to hide the container and display grid lines on print.</p>
<blockquote>
<p>.hide {display:none;}<br />table {border-collapse:collapse;}<br />th, td {border:1px solid black; !important}</p>
</blockquote>
<p>3. add the "setPrintGrid" function call to the end of your grid definition. The function parameters are (grid_id, pager_id, button_title)</p>
<blockquote>
<p>// example jqGrid<br />$(&#39;#tab4-grid&#39;).jqGrid({<br />.<br />pager: &#39;#tab4-pager&#39;,<br />toppager: true, // comment out if you don&#39;t want the the top nav bar.<br />.<br />});</p>
<p>// setup grid print capability. Add print button to navigation bar and bind to click.<br />setPrintGrid(&#39;tab4-grid&#39;,&#39;tab4-pager&#39;,&#39;Customer Grid&#39;);</p>
</blockquote>
<p>4. add the setPrintGrid function definition to some javascript file with a global namespace.</p>
<blockquote>
<p>// setup grid print capability. Add print button to navigation bar and bind to click.<br />function setPrintGrid(gid,pid,pgTitle){<br />&#160; // print button title.<br />&#160; var btnTitle = &#39;Print Grid&#39;;</p>
<p>&#160; // setup print button in the grid top navigation bar.<br />&#160; $(&#39;#&#39;+gid).jqGrid(&#39;navSeparatorAdd&#39;,&#39;#&#39;+gid+&#39;_toppager_left&#39;, {sepclass :&#39;ui-separator&#39;});<br />&#160; $(&#39;#&#39;+gid).jqGrid(&#39;navButtonAdd&#39;,&#39;#&#39;+gid+&#39;_toppager_left&#39;, {caption: &#39;&#39;, title: btnTitle, position: &#39;last&#39;, buttonicon: &#39;ui-icon-print&#39;, onClickButton: function() {PrintGrid();} });</p>
<p>&#160; // setup print button in the grid bottom navigation bar.<br />&#160; $(&#39;#&#39;+gid).jqGrid(&#39;navSeparatorAdd&#39;,&#39;#&#39;+pid, {sepclass : "ui-separator"});<br />&#160; $(&#39;#&#39;+gid).jqGrid(&#39;navButtonAdd&#39;,&#39;#&#39;+pid, {caption: &#39;&#39;, title: btnTitle, position: &#39;last&#39;, buttonicon: &#39;ui-icon-print&#39;, onClickButton: function() { PrintGrid();} });</p>
<p>&#160; function PrintGrid(){<br />&#160;&#160; // empty the print div container.<br />&#160;&#160; $(&#39;#prt-container&#39;).empty();</p>
<p>&#160;&#160; // copy and append grid view to print div container.<br />&#160;&#160; $(&#39;#gview_&#39;+gid).clone().appendTo(&#39;#prt-container&#39;).css({&#39;page-break-after&#39;:&#39;auto&#39;});</p>
<p>&#160;&#160; // remove navigation divs.<br />&#160;&#160; $(&#39;#prt-container div&#39;).remove(&#39;.ui-jqgrid-toppager,.ui-jqgrid-titlebar,.ui-jqgrid-pager&#39;);</p>
<p>&#160;&#160; // print the contents of the print container.<br />&#160;&#160; $(&#39;#prt-container&#39;).printElement({pageTitle:pgTitle, overrideElementCSS:[{ href:&#39;css/print-grid.css&#39;,media:&#39;print&#39;}]});<br />&#160; }<br />}</p>
</blockquote>
<p>I hope it helps someone.</p>
]]></description>
        	        	<pubDate>Fri, 07 Sep 2012 22:28:42 +0300</pubDate>
        </item>
</channel>
</rss>