<?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: printing support</title>
	<link>http://www.trirand.com/blog/?page_id=393/feature-request/printing-support</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/printing-support/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>glemarie on printing support</title>
        	<link>http://www.trirand.com/blog/?page_id=393/feature-request/printing-support#p4581</link>
        	<category>Feature Request</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/feature-request/printing-support#p4581</guid>
        	        	<description><![CDATA[<p>Hi,</p>
<p>I needed this functionality too. What I did is that I added a "print" button in the toolbar.</p>
<p>Then with jQuery, I clone jqGrid table in a new window (a bit dirty to find the table, but It works, even if you have multiple tables on your page) :</p>
<p>// Parent container of the "list" DIV (In my case, I have a DIV includind all elements of a jqGrid table)<br />var idMasterDiv = $(&#39;#&#39;+gridName).parent().parent().attr(&#39;id&#39;);</p>
<p>// Find jqGrid table to print<br />$(&#39;div[id^="jqgh"]&#39;).each ( function() {<br />&#160;&#160;&#160; var idParentDiv = $(this).parent().parent().parent().parent().parent().parent().attr(&#39;id&#39;);<br />&#160;&#160;&#160; <br />&#160;&#160;&#160; if (idParentDiv == idMasterDiv &#38;&#38; objetEntete==false) {<br />&#160;&#160;&#160; &#160;&#160;&#160; objetEntete = $(this).parent().parent().parent(); //&#160; THEAD of the header row (title of the fields)<br />&#160;&#160;&#160; }<br />});</p>
<p>// Create a hidden div which will contain the data to be printed<br />$(&#39;&#60;div&#62;&#39;).attr(&#39;id&#39;, &#39;printDiv&#39;).css(&#39;display&#39;, &#39;none&#39;).appendTo(&#39;body&#39;);<br />// Add css to custom the printed document<br />$(&#39;&#60;link rel="stylesheet" href="css/general.css" media="all" type="text/css"/&#62;&#39;).appendTo(&#39;#printDiv&#39;);<br />$(&#39;&#60;link rel="stylesheet" href="css/print.css" media="all" type="text/css"/&#62;&#39;).appendTo(&#39;#printDiv&#39;);<br />$(&#39;&#60;table&#62;&#39;).attr(&#39;id&#39;, &#39;t_printDiv&#39;).appendTo(&#39;#printDiv&#39;);<br />// Clone jqGrid table header<br />$(&#39;&#60;caption&#62;&#39;+titrePage+&#39;&#60;/caption&#62;&#39;).appendTo(&#39;#t_printDiv&#39;);<br />objetEntete.clone().appendTo(&#39;#t_printDiv&#39;);<br />// Clone jqGrid data<br />$(&#39;#&#39;+gridName+&#39; tbody:first&#39;).clone().appendTo(&#39;#t_printDiv&#39;);<br />$(&#39;&#60;/table&#62;&#39;).appendTo(&#39;#printDiv&#39;);</p>
<p>// Open a new window<br />var WindowObject = window.open(&#39;&#39;, "TrackHistoryData", <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; "width=900,height=400,top=200,left=150,toolbars=yes,scrollbars=yes,status=no,resizable=no");<br />// Send the DIV to be printed in the window<br />WindowObject.document.writeln($(&#39;#printDiv&#39;).attr(&#39;innerHTML&#39;));<br />// Clean the current document<br />$(&#39;#printDiv&#39;).remove();<br />WindowObject.document.close();<br />// Print the table<br />WindowObject.focus();<br />WindowObject.print();<br />WindowObject.close();<br />}</p>
</p>
<p>If anybody have a more simple way of finding the corect &#60;thead&#62; &#38; &#60;tbody&#62; elements to print, I&#39;ll be glad !</p>
]]></description>
        	        	<pubDate>Wed, 11 Feb 2009 16:35:53 +0200</pubDate>
        </item>
        <item>
        	<title>tony on printing support</title>
        	<link>http://www.trirand.com/blog/?page_id=393/feature-request/printing-support#p1862</link>
        	<category>Feature Request</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/feature-request/printing-support#p1862</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>I think that this is a "little" difficult. Printing from html is a not trivial task.</p>
<p>You can construct you own printing function. You have all the needed</p>
<p>data and can construct what you want.</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Wed, 03 Sep 2008 04:32:24 +0300</pubDate>
        </item>
        <item>
        	<title>drlinux on printing support</title>
        	<link>http://www.trirand.com/blog/?page_id=393/feature-request/printing-support#p1856</link>
        	<category>Feature Request</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/feature-request/printing-support#p1856</guid>
        	        	<description><![CDATA[<p>new version pls add the printing support for records, many thanks.</p>
<p>regards,</p>
<p>ibrahim.</p>
]]></description>
        	        	<pubDate>Tue, 02 Sep 2008 07:35:11 +0300</pubDate>
        </item>
</channel>
</rss>