<?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 search with selects and text</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-search-with-selects-and-text</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-search-with-selects-and-text/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>saburo on Jqgrid search with selects and text</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-search-with-selects-and-text#p26363</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/jqgrid-search-with-selects-and-text#p26363</guid>
        	        	<description><![CDATA[<p>Hello, I am enjoying jqgrid and nomrally I am able to find the answer to the issues I encounter by searching the web, this time I failed :</p>
<p>I have a grid application that generates dynamically the js code to build the jqgrid object.</p>
<p>Some columns are dcefined as selects, others as normal text, depending on the table I am browsing.</p>
<p>Note : I am using local data (an array) which displays and updates (with some custom made functions for this) fine</p>
<p>The issue is with the search functionality as the list of values is generated dynamically and placed &#160;in the editoptions.</p>
<p>I noticved that values showed up in the filtertoolbarf, but not in the form search, so I added searchoptions (also to add an "all" option) dynamically in this way :</p>
<p>var cm = $("#grid1").jqGrid(&#39;getGridParam&#39;,&#39;colModel&#39;);</p>
<p>&#160;for (var i = 0;i&#60;cm.length;i++)</p>
<p>&#160; {&#160;</p>
<p>&#160; &#160;if (cm[i].formatter == "select")</p>
<p>&#160; {</p>
<p>&#160; &#160; &#160; <br />&#160; &#160; &#160; var lst = ":All;"+cm[i].editoptions.value;</p>
<p>&#160; &#160;&#160; &#160;cm[i].searchoptions = {sopt:[&#39;eq&#39;,&#39;ne&#39;] , value : lst}; &#160;</p>
<p>&#160; }</p>
<p>&#160;}</p>
<p>&#160;$("#grid1").jqGrid(&#39;setGridParam&#39;,&#39;colModel&#39;,cm).trigger("reloadGrid");</p>
</p>
<p>I then get again the colmodel and dump it to the chrome console to check that values were set properly, which is the case.</p>
</p>
<p>The issues I have are :</p>
<p>1) In the filter toolbar the "all" option is not visible, all the other values are correct for all the columns</p>
<p>2) In the search&#160;form the "all" option is visible, but &#160;I always get the first field select values regardless of the field I chose (included the text ones, the search text field remains a select also for stype="text" fields.</p>
</p>
<p>Any idea?</p>
</p>
<p>Thanks&#160;</p>
]]></description>
        	        	<pubDate>Fri, 13 Apr 2012 11:32:32 +0300</pubDate>
        </item>
</channel>
</rss>