<?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: My first grid</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/my-first-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/my-first-grid/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>paulojsp on My first grid</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/my-first-grid#p13095</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/my-first-grid#p13095</guid>
        	        	<description><![CDATA[<p><span title="eu encontrei o problema (erro de principiante).">I found the problem (beginner&#39;s mistake).</span></p>
<p><span title="desculpem pelo post anterior.">sorry the previous post.</span></p>
<p><span title="obrigado na mesma">thanks anyway</span></p>
]]></description>
        	        	<pubDate>Wed, 16 Dec 2009 21:43:39 +0200</pubDate>
        </item>
        <item>
        	<title>paulojsp on My first grid</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/my-first-grid#p13080</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/my-first-grid#p13080</guid>
        	        	<description><![CDATA[<p>hi,</p>
<p>i&#39;m trying to use for the first time the jQuery Grid, but i&#39;m stuck in the same problem over two days&#8230;</p>
<p>error:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit7333' value='Select Code' data-codeid='sfcode7333' /></p>
<div class='sfcode' id='sfcode7333'><a class="console-message-url " onclick="function onclick() { function onclick() { function onclick() { function onclick() { function onclick() { function onclick() { function onclick() { function onclick() { pageTracker._trackPageview(&#39;/outbound/article/http://localhost/JGRIDV2/js/jquery.js&#39;); } } } } } } } }" href="http://localhost/JGRIDV2/js/jquery.js" target="_blank">jquery.js:641</a>&#160;<span class="console-message-text"><span>Uncaught TypeError: Cannot read property &#39;nodeType&#39; of null</span></span></div>
<p>My code using the table from the manual example:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit3103' value='Select Code' data-codeid='sfcode3103' /></p>
<div class='sfcode' id='sfcode3103'>
<p>&#60;html&#62; &#60;head&#62;</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#60;title&#62;jqGrid Demo&#60;/title&#62;</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#60;link rel=&#8221;stylesheet&#8221; type=&#8221;text/css&#8221; media=&#8221;screen&#8221; href=&#8221;css/ui-lightness/jquery-ui-1.7.1.custom.css&#8221; /&#62;</p>
<p>&#60;link rel=&#8221;stylesheet&#8221; type=&#8221;text/css&#8221; media=&#8221;screen&#8221; href=&#8221;css/ui.jqgrid.css&#8221; /&#62;</p>
<p>&#60;script src=&#8221;js/jquery-1.3.2.min.js&#8221; type=&#8221;text/javascript&#8221;&#62;&#60;/script&#62;</p>
<p>&#60;script src=&#8221;js/jquery.js&#8221; type=&#8221;text/javascript&#8221;&#62;&#60;/script&#62;</p>
<p>&#60;script src=&#8221;js/i18n/grid.locale-en.js&#8221; type=&#8221;text/javascript&#8221;&#62;&#60;/script&#62;</p>
<p>&#60;script src=&#8221;js/jquery.jqGrid.min.js&#8221; type=&#8221;text/javascript&#8221;&#62;&#60;/script&#62;</p>
<p>&#60;script type=&#8221;text/javascript&#8221;&#62;</p>
<p style="padding-left: 30px;">jQuery(document).ready(function(){</p>
<p style="padding-left: 30px;">jQuery(&#8221;#list&#8221;).jqGrid({ <a href="/blog/&#39;example1.php&#39;" target="_blank">url:&#39;example1.php&#39;</a>,</p>
<p style="padding-left: 30px;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;datatype: &#39;xml&#39;, mtype: &#39;GET&#39;,</p>
<p style="padding-left: 30px;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;colNames:[&#39;Inv No&#39;,&#39;Date&#39;, &#39;Amount&#39;,&#39;Tax&#39;,&#39;Total&#39;,&#39;Notes&#39;],</p>
<p style="padding-left: 30px;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;colModel :[ {name:&#39;invid&#39;, index:&#39;invid&#39;, width:55},</p>
<p style="padding-left: 30px;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{name:&#39;invdate&#39;, index:&#39;invdate&#39;, width:90},</p>
<p style="padding-left: 30px;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{name:&#39;amount&#39;, index:&#39;amount&#39;, width:80, align:&#39;right&#39;},</p>
<p style="padding-left: 30px;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{name:&#39;tax&#39;, index:&#39;tax&#39;, width:80, align:&#39;right&#39;},</p>
<p style="padding-left: 30px;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{name:&#39;total&#39;, index:&#39;total&#39;, width:80, align:&#39;right&#39;},</p>
<p style="padding-left: 30px;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{name:&#39;note&#39;, index:&#39;note&#39;, width:150, sortable:false} ],</p>
<p style="padding-left: 30px;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;pager: jQuery(&#39;#pager&#39;), rowNum:10, rowList:[10,20,30],</p>
<p style="padding-left: 30px;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;sortname: &#39;invid&#39;, sortorder: &#39;note&#39;, viewrecords: true,</p>
<p style="padding-left: 30px;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;caption: &#39;My first grid&#39; }); });</p>
<p style="padding-left: 30px;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#60;/script&#62; &#60;/head&#62; &#60;body&#62; &#60;table id=&#8221;list&#8221; class=&#8221;scroll&#8221;&#62;&#60;/table&#62;</p>
<p style="padding-left: 30px;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#60;div id=&#8221;pager&#8221; class=&#8221;scroll&#8221; style=&#8221;text-align:center;&#8221;&#62;&#60;/div&#62;</p>
<p style="padding-left: 30px;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#60;/body&#62; &#60;/html&#62;</p>
</div>
<p>php output:&#160;</p>
<p><input type='button' class='sfcodeselect' name='sfselectit315' value='Select Code' data-codeid='sfcode315' /></p>
<div class='sfcode' id='sfcode315'>&#60;meta http-equiv=&#8221;Content-Type&#8221; content=&#8221;text/html; charset=UTF-8&#8243;&#62; </p>
<p>&#60;rows&#62;&#60;page&#62;1&#60;/page&#62;&#60;total&#62;1&#60;/total&#62;&#60;records&#62;4&#60;/records&#62;&#60;row id=&#39;1&#39;&#62;&#60;cell&#62;1&#60;/cell&#62;&#60;cell&#62;2009-12-16&#60;/cell&#62;&#60;cell&#62;3.00&#60;/cell&#62;&#60;cell&#62;2.00&#60;/cell&#62;&#60;cell&#62;3.00&#60;/cell&#62;&#60;cell&#62;&#60;![CDATA[dsfsdf]]&#62;&#60;/cell&#62;&#60;/row&#62;&#60;row id=&#39;2&#39;&#62;&#60;cell&#62;2&#60;/cell&#62;&#60;cell&#62;2009-12-16&#60;/cell&#62;&#60;cell&#62;3.00&#60;/cell&#62;&#60;cell&#62;2.00&#60;/cell&#62;&#60;cell&#62;3.00&#60;/cell&#62;&#60;cell&#62;&#60;![CDATA[dsfsdf]]&#62;&#60;/cell&#62;&#60;/row&#62;&#60;row id=&#39;3&#39;&#62;&#60;cell&#62;3&#60;/cell&#62;&#60;cell&#62;2009-12-16&#60;/cell&#62;&#60;cell&#62;3.00&#60;/cell&#62;&#60;cell&#62;2.00&#60;/cell&#62;&#60;cell&#62;3.00&#60;/cell&#62;&#60;cell&#62;&#60;![CDATA[dsfsgfhfhfgh]]&#62;&#60;/cell&#62;&#60;/row&#62;&#60;row id=&#39;4&#39;&#62;&#60;cell&#62;4&#60;/cell&#62;&#60;cell&#62;2009-12-16&#60;/cell&#62;&#60;cell&#62;5.00&#60;/cell&#62;&#60;cell&#62;9.00&#60;/cell&#62;&#60;cell&#62;3.00&#60;/cell&#62;&#60;cell&#62;&#60;![CDATA[dsfsgfhfhfgh]]&#62;&#60;/cell&#62;&#60;/row&#62;&#60;/rows&#62;</p>
</div>
</p>
<p>php file:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit1191' value='Select Code' data-codeid='sfcode1191' /></p>
<div class='sfcode' id='sfcode1191'>
<p>&#60;?php<br />include (&#8221;startBD.php&#8221;);<br />$page = $_GET[&#39;page&#39;];<br />$limit = $_GET[&#39;rows&#39;];<br />$sidx = $_GET[&#39;sidx&#39;];<br />$sord = $_GET[&#39;sord&#39;];<br />if(!$sidx) $sidx =1;<br />$result = mysql_query(&#8221;SELECT COUNT(*) AS count FROM invheader&#8221;);<br />$row = mysql_fetch_array($result,MYSQL_ASSOC);<br />$count = $row[&#39;count&#39;]; <br />if( $count &#62; 0 ) {<br />&#160;&#160;&#160; $total_pages = ceil($count/$limit);<br />} else {<br />&#160;&#160;&#160; $total_pages = 0;<br />}<br />if ($page &#62; $total_pages) $page=$total_pages;<br />$start = $limit*$page &#8211; $limit;<br />if($start &#60;0) $start = 0; // the actual query for the grid data<br />$SQL = &#8220;SELECT invid, invdate, amount, tax,total, note FROM invheader ORDER BY $sidx;&#8221;;<br />$result = mysql_query( $SQL ) or die(&#8221;Couldn&#39;t execute query.&#8221;.mysql_error());<br />if ( stristr($_SERVER["HTTP_ACCEPT"],&#8221;application/xhtml+xml&#8221;) ) {<br />&#160;&#160;&#160; header(&#8221;Content-type: text/xml;charset=utf-8&#8243;);<br />}<br />else {<br />&#160;&#160;&#160; header(&#8221;Content-type: text/xml;charset=utf-8&#8243;);<br />}<br />echo &#8220;&#60;?xml version=&#39;1.0&#39; encoding=&#39;utf-8&#39;?&#62;&#8221;;<br />echo &#8220;&#60;rows&#62;&#8221;;<br />echo &#8220;&#60;page&#62;&#8221;.$page.&#8221;&#60;/page&#62;&#8221;;<br />echo &#8220;&#60;total&#62;&#8221;.$total_pages.&#8221;&#60;/total&#62;&#8221;;<br />echo &#8220;&#60;records&#62;&#8221;.$count.&#8221;&#60;/records&#62;&#8221;; // be sure to put text data in CDATA<br />while($row = mysql_fetch_array($result,MYSQL_ASSOC)) {<br />&#160;&#160;&#160; echo &#8220;&#60;row id=&#39;&#8221;. $row[&#39;invid&#39;].&#8221;&#39;&#62;&#8221;;<br />&#160;&#160;&#160; echo &#8220;&#60;cell&#62;&#8221;. $row[&#39;invid&#39;].&#8221;&#60;/cell&#62;&#8221;;<br />&#160;&#160;&#160; echo &#8220;&#60;cell&#62;&#8221;. $row[&#39;invdate&#39;].&#8221;&#60;/cell&#62;&#8221;;<br />&#160;&#160;&#160; echo &#8220;&#60;cell&#62;&#8221;. $row[&#39;amount&#39;].&#8221;&#60;/cell&#62;&#8221;;<br />&#160;&#160;&#160; echo &#8220;&#60;cell&#62;&#8221;. $row[&#39;tax&#39;].&#8221;&#60;/cell&#62;&#8221;;<br />&#160;&#160;&#160; echo &#8220;&#60;cell&#62;&#8221;. $row[&#39;total&#39;].&#8221;&#60;/cell&#62;&#8221;;<br />&#160;&#160;&#160; echo &#8220;&#60;cell&#62;&#60;![CDATA[". $row[&#39;note&#39;].&#8221;]]&#62;&#60;/cell&#62;&#8221;;<br />&#160;&#160;&#160; echo &#8220;&#60;/row&#62;&#8221;;<br />} echo</p>
<p>&#8220;&#60;/rows&#62;&#8221;; ?&#62;</p>
</div>
<p>i can use some help!</p>
</p>
<p>thanks ^^</p>
]]></description>
        	        	<pubDate>Wed, 16 Dec 2009 14:24:39 +0200</pubDate>
        </item>
</channel>
</rss>