<?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: Toolbar Search or Filter</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/toolbar-search-or-filter</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/toolbar-search-or-filter/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>GeorgeIoak on Toolbar Search or Filter</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/toolbar-search-or-filter#p24048</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/toolbar-search-or-filter#p24048</guid>
        	        	<description><![CDATA[<p>Found it!</p>
</p>
<p>Change</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit5409' value='Select Code' data-codeid='sfcode5409' /></p>
<div class='sfcode' id='sfcode5409'>$searchstr = $_REQUEST[&#39;filters&#39;];</div>
<p>to:</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit534' value='Select Code' data-codeid='sfcode534' /></p>
<div class='sfcode' id='sfcode534'>$searchstr = stripslashes($_REQUEST[&#39;filters&#39;]);</div>
<p>ans this works for me at least with the initial testing in FF</p>
]]></description>
        	        	<pubDate>Sun, 24 Jul 2011 08:57:16 +0300</pubDate>
        </item>
        <item>
        	<title>GeorgeIoak on Toolbar Search or Filter</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/toolbar-search-or-filter#p24047</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/toolbar-search-or-filter#p24047</guid>
        	        	<description><![CDATA[<p>I found your code and was trying to use it but have run into some problems. I added some debug code to check the SQL statement and I found that the WHERE clause was not being created.</p>
</p>
<p>searchstr variable is set to:&#160;</p>
<pre><p><input type='button' class='sfcodeselect' name='sfselectit9689' value='Select Code' data-codeid='sfcode9689' /></p><div class='sfcode' id='sfcode9689'>{"groupOp":"AND","rules":[{"field":"lname","op":"bw","data":"s"</div><p><input type='button' class='sfcodeselect' name='sfselectit3936' value='Select Code' data-codeid='sfcode3936' /></p><div class='sfcode' id='sfcode3936'>}]}<br /><br />but json_decode returns empty.<br /><br />When I use FireBug to look at the parameters I see that filters is set to:<br /><br /></div></pre>
<table class="netInfoParamsText netInfoText netInfoParamsTable " border="0" cellspacing="0" cellpadding="0">
<tbody class=" ">
<tr class=" ">
<td class="netInfoParamName "></td>
<td class="netInfoParamValue ">
<p><input type='button' class='sfcodeselect' name='sfselectit3996' value='Select Code' data-codeid='sfcode3996' /></p>
<div class='sfcode' id='sfcode3996'>{"groupOp":"AND","rules":[{"field":"lname","op":"bw","data":"s"}]}</div>
</td>
</tr>
</tbody>
</table>
<pre><br />Are the "" the problem why json_decode is not working and if so where did they come from??</pre>
]]></description>
        	        	<pubDate>Sun, 24 Jul 2011 08:30:18 +0300</pubDate>
        </item>
        <item>
        	<title>nickelj on Toolbar Search or Filter</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/toolbar-search-or-filter#p20336</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/toolbar-search-or-filter#p20336</guid>
        	        	<description><![CDATA[<p>Took me a while, but I tracked down some code that seems to work.</p>
</p>
<p>Just thought I would share with the group:</p>
</p>
<p>&#60;CODE&#62;</p>
<p>$where = "";<br />$searchOn = $_REQUEST[&#39;_search&#39;];<br />if($searchOn==&#39;true&#39;) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $searchstr = $_REQUEST[&#39;filters&#39;];<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $where = constructWhere($searchstr);<br />}<br />function constructWhere($s){<br />&#160;&#160;&#160; $qwery = "";<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; //[&#39;eq&#39;,&#39;ne&#39;,&#39;lt&#39;,&#39;le&#39;,&#39;gt&#39;,&#39;ge&#39;,&#39;bw&#39;,&#39;bn&#39;,&#39;in&#39;,&#39;ni&#39;,&#39;ew&#39;,&#39;en&#39;,&#39;cn&#39;,&#39;nc&#39;]<br />&#160;&#160;&#160; $qopers = array(<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#39;eq&#39;=&#62;" = ",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#39;ne&#39;=&#62;" &#60;&#62; ",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#39;lt&#39;=&#62;" &#60; ",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#39;le&#39;=&#62;" &#60;= ",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#39;gt&#39;=&#62;" &#62; ",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#39;ge&#39;=&#62;" &#62;= ",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#39;bw&#39;=&#62;" LIKE ",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#39;bn&#39;=&#62;" NOT LIKE ",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#39;in&#39;=&#62;" IN ",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#39;ni&#39;=&#62;" NOT IN ",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#39;ew&#39;=&#62;" LIKE ",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#39;en&#39;=&#62;" NOT LIKE ",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#39;cn&#39;=&#62;" LIKE " ,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#39;nc&#39;=&#62;" NOT LIKE " );<br />&#160;&#160;&#160; if ($s) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $jsona = json_decode($s,true);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; if(is_array($jsona)){<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $gopr = $jsona[&#39;groupOp&#39;];<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $rules = $jsona[&#39;rules&#39;];<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $i =0;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; foreach($rules as $key=&#62;$val) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $field = $val[&#39;field&#39;];<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $op = $val[&#39;op&#39;];<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $v = $val[&#39;data&#39;];<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if($v &#38;&#38; $op) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $i++;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // ToSql in this case is absolutley needed<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $v = ToSql($field,$op,$v);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if ($i == 1) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $qwery = "WHERE ";<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; } else {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $qwery .= " " .$gopr." ";<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<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;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; switch ($op) {<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;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // in need other thing<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;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; case &#39;in&#39; :<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;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; case &#39;ni&#39; :<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;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $qwery .= $field.$qopers[$op]." (".$v.")";<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;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; break;</p>
<p>&#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;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; default:<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;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $qwery .= $field.$qopers[$op].$v;<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;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<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;&#160;&#160; }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160; }<br />&#160;&#160;&#160; return $qwery;<br />}<br />function ToSql ($field, $oper, $val) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; // we need here more advanced checking using the type of the field - i.e. integer, string, float<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; switch ($field) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; case &#39;id&#39;:<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return intval($val);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; break;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; case &#39;amount&#39;:<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; case &#39;tax&#39;:<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; case &#39;total&#39;:<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return floatval($val);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; break;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; default :<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; //mysql_real_escape_string is better<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if($oper==&#39;bw&#39; &#124;&#124; $oper==&#39;bn&#39;) return "&#39;" . addslashes($val) . "%&#39;";<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; else if ($oper==&#39;ew&#39; &#124;&#124; $oper==&#39;en&#39;) return "&#39;%" . addcslashes($val) . "&#39;";<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; else if ($oper==&#39;cn&#39; &#124;&#124; $oper==&#39;nc&#39;) return "&#39;%" . addslashes($val) . "%&#39;";<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; else return "&#39;" . addslashes($val) . "&#39;";<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />}</p>
]]></description>
        	        	<pubDate>Sat, 16 Oct 2010 04:58:35 +0300</pubDate>
        </item>
        <item>
        	<title>nickelj on Toolbar Search or Filter</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/toolbar-search-or-filter#p20312</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/toolbar-search-or-filter#p20312</guid>
        	        	<description><![CDATA[<p>Hey...thanks for making jqgrid - looks great!</p>
</p>
<p>I am just getting started and I have a couple things.</p>
</p>
<p>In the examples (/blog/jqgrid/jqgrid.html), under New in version 3.7 is Toolbar Search.</p>
<p>It is spelt "Tooolbar search" - small thing I know.</p>
<p>More importantly, the PHP code shows&#160;a reference to a "$where" variable, but this variable is never declared or calculated. How do you get the filter information into the "$where" variable?</p>
</p>
<p>The code for the Virtual scrolling looks exactly the same...it doesn&#39;t explain the "$where" variable either.</p>
</p>
<p>I don&#39;t suppose there is anywhere to download examples from to run on my own server? It would sure help to have a few working examples (I am using PHP and MySQL).</p>
</p>
<p>Jim</p>
]]></description>
        	        	<pubDate>Fri, 15 Oct 2010 06:15:42 +0300</pubDate>
        </item>
</channel>
</rss>