<?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: jQgrid fails when I use server side sorting</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-fails-when-i-use-server-side-sorting</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/jqgrid-fails-when-i-use-server-side-sorting/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>dancombs on jQgrid fails when I use server side sorting</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-fails-when-i-use-server-side-sorting#p26902</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/jqgrid-fails-when-i-use-server-side-sorting#p26902</guid>
        	        	<description><![CDATA[<p>I have a select input that chooses and populates a jQgrid (#1). When a row is selected on this jQgrid (#1), a second jQgrid (#2) is populated. This is where the problem comes in. Here is the rowselect:</p>
</p>
<p>&#160;&#160;&#160; onSelectRow: function(id){ <br />&#160;&#160; &#160;&#160;&#160; &#160;if(id == null) <br />&#160;&#160; &#160;&#160;&#160; &#160;{<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; id=0;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; if($("#ship").jqGrid(&#39;getGridParam&#39;,&#39;records&#39;) &#62;0 ) <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; { <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; &#160;&#160; &#160; $("#ship").jqGrid(&#39;setGridParam&#39;,{url:"ship.php?uic="+id}); <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; $("#ship").jqGrid(&#39;setCaption&#39;,"That UIC: "+id).trigger(&#39;reloadGrid&#39;); <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; } <br />&#160;&#160; &#160;&#160;&#160; &#160;}<br />&#160;&#160; &#160;&#160;&#160; &#160;else <br />&#160;&#160; &#160;&#160;&#160; &#160;{ <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;$("#ship").jqGrid(&#39;setGridParam&#39;,{url:"ship.php?uic="+id}); <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;$("#ship").jqGrid(&#39;setCaption&#39;,"This UIC: "+id).trigger(&#39;reloadGrid&#39;); </p>
<p>The file ship.php takes a 6 digit uic code and processes it via:</p>
<p style="padding-left: 30px;">$uic = $_GET[&#39;uic&#39;];</p>
<p>If I use this select statement in ship.php:</p>
<p style="padding-left: 30px;">$query_rsShip = "SELECT UIC, Command_Name, Hull_Number FROM command ORDER BY $sidx $sord LIMIT $start , $limit";</p>
<p>it passes all the rows of data to jQgrid (#ship). If I put a where clause on my select statement like so:</p>
<p style="padding-left: 30px;">$query_rsShip = "SELECT UIC, Command_Name, Hull_Number FROM command <strong>WHERE UIC = ".$uic." </strong>ORDER BY $sidx $sord LIMIT $start , $limit";</p>
<p>No rows are returned.</p>
<p>if I try this:</p>
<p style="padding-left: 30px;">$query_rsShip = "SELECT UIC, Command_Name, Hull_Number FROM command <strong><span style="color: #ff0000;">WHERE UIC != ".$uic."</span> </strong>ORDER BY $sidx $sord LIMIT $start , $limit";</p>
<p><span style="color: #000000;">Again, I get all the rows</span></p>
<p>Then I thought, alright, lets get all the rows and filter them separately like so:</p>
<p style="padding-left: 30px;">while($row = mysql_fetch_array($rsShip,MYSQL_ASSOC)) {<br />&#160;&#160; &#160;$diff = strcasecmp ( $row[&#39;UIC&#39;], $uic);<br />&#160;&#160; &#160;if ( $diff == 0) {<br />&#160;&#160; &#160;&#160;&#160;&#160; $s .= "&#60;row id=&#39;". $row[&#39;UIC&#39;]."&#39;&#62;";&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;$s .= "&#60;cell&#62;". $row[&#39;UIC&#39;]."&#60;/cell&#62;";<br />&#160;&#160; &#160;&#160;&#160; &#160;$s .= "&#60;cell&#62;". $row[&#39;Command_Name&#39;]."&#60;/cell&#62;";<br />&#160;&#160; &#160;&#160;&#160; &#160;$s .= "&#60;cell&#62;". $row[&#39;Hull_Number&#39;]."&#60;/cell&#62;";</p>
<p>No rows are returned. If I comment out the if clause, it passes all the rows of data.</p>
<p>I&#39;m completely stumped. I&#39;m not sure what else I could try <img class="spSmiley" style="margin:0" title="Cry" src="/blog/wp-content/forum-smileys/sf-cry.gif" alt="Cry" /></p></p>
]]></description>
        	        	<pubDate>Fri, 06 Jul 2012 02:39:44 +0300</pubDate>
        </item>
</channel>
</rss>