<?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: A few questions about Search</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/a-few-questions-about-search</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/a-few-questions-about-search/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>Romyn on A few questions about Search</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/a-few-questions-about-search#p11517</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/a-few-questions-about-search#p11517</guid>
        	        	<description><![CDATA[<p>That&#39;s a good question which unfortunately I don&#39;t know the answer.</p>
</p>
<p>I just copied one of the examples and changed the Select to point to my table structure. I don&#39;t know why it&#39;s doing what it&#39;s doing and I&#39;ll have to look into it and hopefully find a permanent solution.</p>
</p>
<p>In the meantime I&#39;ve amended the PHP by adding near the beginning...</p>
<p>if ($page == 0) {<br />&#160;&#160;&#160; $page =1;<br />}</p>
<p>... and that seems to sort the problem out - although obviously the underlying cause is still there somewhere.</p>
</p>
<p>Thanks very much Tony for your time, and patience, I&#39;m very grateful for it.</p>
</p>
<p>Kindest regards</p>
<p>Romyn</p>
]]></description>
        	        	<pubDate>Wed, 04 Nov 2009 23:51:14 +0200</pubDate>
        </item>
        <item>
        	<title>tony on A few questions about Search</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/a-few-questions-about-search#p11514</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/a-few-questions-about-search#p11514</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>By default when the grid initialize we ask for page 1. You will need to check your code.</p>
<p>Also a better appoach is to check these server side and return the appropriate value from server.</p>
<p>Let me explain: If you ask for page:0 (posted from grid) - why your server return data?</p>
<p>In this case server should not return data.</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Wed, 04 Nov 2009 23:32:46 +0200</pubDate>
        </item>
        <item>
        	<title>Romyn on A few questions about Search</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/a-few-questions-about-search#p11489</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/a-few-questions-about-search#p11489</guid>
        	        	<description><![CDATA[<p>Hi,</p>
</p>
<p>I get that - and that&#39;s the problem I&#39;m trying to solve.</p>
</p>
<p>I don&#39;t know what I&#39;m doing that causes the grid to ask for page 0.Why is page 0 in my Headers and thereofre in the Response?</p>
</p>
<p>Put it another way - if I wanted to open the grid on page 5 what would I need to do.</p>
</p>
<p>Thanks</p>
<p>Romyn</p>
]]></description>
        	        	<pubDate>Wed, 04 Nov 2009 09:56:02 +0200</pubDate>
        </item>
        <item>
        	<title>tony on A few questions about Search</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/a-few-questions-about-search#p11469</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/a-few-questions-about-search#p11469</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>No problem, but did you see your first response &#8211; you have page:&#8221;0&#8243; &#8211; this causes the problem.</p>
<p>Also correct your first server response to return page:&#8221;1&#8243;.</p>
<p>Pages start cont from 1 and not from 0</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Wed, 04 Nov 2009 04:21:30 +0200</pubDate>
        </item>
        <item>
        	<title>Romyn on A few questions about Search</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/a-few-questions-about-search#p11441</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/a-few-questions-about-search#p11441</guid>
        	        	<description><![CDATA[<p>Sorry - don&#39;t quite understand what you mean with that "trick".</p>
</p>
<p>The first call sends the Headers:-</p>
</p>
<p>_search false</p>
<p>nd ... (a long number)</p>
<p>page 0</p>
<p>rows 10</p>
<p>sidx place_overall</p>
<p>sord asc</p>
</p>
<p>Response begins with (up to start of 2nd record):-</p>
</p>
<pre><code>{"page":"0","total":2,"records":"20","rows":[{"id":"19948","cell":["19948","1","8","Keflezighi","Meb"</code><code>,"M","34","02:09:14"]},{"id":.........<br /><br />With that I get the funny records numbers.<br />After a sort the Headers and Response are the same except<br /></code></pre>
<p>Headers has:- page 1</p>
<p>Response has:- <code>{"page":"1" ........</code></p>
</p>
<p>Not sure if that helps at all?</p>
</p>
<p>Romyn</p>
]]></description>
        	        	<pubDate>Tue, 03 Nov 2009 01:40:29 +0200</pubDate>
        </item>
        <item>
        	<title>tony on A few questions about Search</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/a-few-questions-about-search#p11423</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/a-few-questions-about-search#p11423</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>I want to see the server response from the first cal, but yo can use the following trick</p>
<p>$(&#8221;#grid_rm_search&#8221;).jqGrid({</p>
<p>....</p>
<p>datatype:&#39;local&#39;,</p>
<p>url: &#39;your url&#39;,</p>
</p>
<p>....</p>
<p>});</p>
<p>(&#8221;#grid_rm_search&#8221;).setGridParam({datatype:&#39;json&#39;}).trigger(&#8221;reloadGrid&#8221;);</p>
<p>Regards</p>
<p>Tony</p></p>
]]></description>
        	        	<pubDate>Mon, 02 Nov 2009 13:50:53 +0200</pubDate>
        </item>
        <item>
        	<title>Romyn on A few questions about Search</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/a-few-questions-about-search#p11335</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/a-few-questions-about-search#p11335</guid>
        	        	<description><![CDATA[<p>Thanks Tony,</p>
</p>
<p>With 1 &#38; 3 I was looking in the wrong place - fixed now - your fault for making jqGrid so comprehensive 😉</p>
</p>
<p>Your suggestion for 2 works a treat 🙂</p>
</p>
<p>As for number 4 ... what seems to be happening is when the grid initially loads the header sent to the url.php is asking for page=0 and the records say "-9 to 0" when returned - although the grid contains records 1-10. As soon as I do a sort or reset then next call is correct for page=1.</p>
<p>I can&#39;t see what I&#39;m doing to cause this to happen. The only thing slightly different about the grid is that when I initially set it up I give it a dummy url which I then change using setGridParam and then use trigger("reloadGrid") to fill it.</p>
</p>
<p>This is the grid:-</p>
</p>
<p>&#160;&#160;&#160; $("#grid_rm_search").jqGrid({<br />&#160;&#160;&#160; &#160;&#160;&#160; url:&#39;php/race_resultssearch.php?r=0&#39;,<br />&#160;&#160;&#160; &#160;&#160;&#160; datatype: "json",<br />&#160;&#160;&#160; &#160;&#160;&#160; autowidth: true,<br />&#160;&#160;&#160; &#160;&#160;&#160; height: &#39;auto&#39;,<br />&#160;&#160;&#160; &#160;&#160;&#160; shrinkToFit: false,<br />&#160;&#160;&#160; &#160;&#160;&#160; colNames:[&#39;racer_id&#39;,&#39;Pos&#39;,&#39;Bib#&#39;, &#39;Last Name&#39;, &#39;First Name&#39;, &#39;Sex&#39;, &#39;Age&#39;, &#39;Time&#39;],<br />&#160;&#160;&#160; &#160;&#160;&#160; colModel:[<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;racer_id&#39;,index:&#39;id&#39;, width:1, hidden:true, search:false},<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;place_overall&#39;, index:&#39;place_overall&#39;,width:35, searchoptions:{sopt:[&#39;eq&#39;,&#39;le&#39;,&#39;ge&#39;]}},<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;racer_no&#39;,index:&#39;racer_no&#39;, width:40, searchoptions:{sopt:[&#39;eq&#39;,&#39;cn&#39;]}},<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;last_name&#39;, index:&#39;last_name&#39;,width:75, searchoptions:{sopt:[&#39;eq&#39;,&#39;bw&#39;,&#39;ew&#39;,&#39;cn&#39;]}},<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;first_name&#39;, index:&#39;first_name&#39;,width:75, searchoptions:{sopt:[&#39;eq&#39;,&#39;bw&#39;,&#39;ew&#39;,&#39;cn&#39;]}},<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;sex&#39;, index:&#39;sex&#39;,width:25, searchoptions:{sopt:[&#39;eq&#39;]}},<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;age&#39;, index:&#39;age&#39;,width:25, searchoptions:{sopt:[&#39;eq&#39;,&#39;le&#39;,&#39;ge&#39;]}},<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;time_complete_dt&#39;, index:&#39;time_complete_dt&#39;,width:50, search:false}&#160;&#160;&#160; &#160;&#160;&#160; <br />&#160;&#160;&#160; &#160;&#160;&#160; ],<br />&#160;&#160;&#160; &#160;&#160;&#160; rowNum:10,<br />&#160;&#160;&#160; &#160;&#160;&#160; mtype: "POST",<br />&#160;&#160;&#160; &#160;&#160;&#160; pager: &#39;#grid_rm_search_pager&#39;,<br />&#160;&#160;&#160; &#160;&#160;&#160; sortname: &#39;place_overall&#39;,<br />&#160;&#160;&#160; &#160;&#160;&#160; toolbar: [true,"top"],<br />&#160;&#160;&#160; &#160;&#160;&#160; viewrecords: true,<br />&#160;&#160;&#160; &#160;&#160;&#160; rownumbers: false,<br />&#160;&#160;&#160; &#160;&#160;&#160; pginput: false, <br />&#160;&#160;&#160; &#160;&#160;&#160; gridview : true,<br />&#160;&#160;&#160; &#160;&#160;&#160; sortorder: "asc"<br />&#160;&#160;&#160; }).navGrid(&#39;#grid_rm_search_pager&#39;,<br />&#160;&#160;&#160; {<br />&#160;&#160;&#160; &#160;&#160;&#160; edit:false,add:false,del:false,search:false,refresh:true<br />&#160;&#160;&#160; },<br />&#160;&#160;&#160; {}, // edit options<br />&#160;&#160;&#160; {}, // add options<br />&#160;&#160;&#160; {}, //del options<br />&#160;&#160;&#160; {<br />&#160;&#160;&#160; &#160;&#160;&#160; multipleSearch:true, <br />&#160;&#160;&#160; &#160;&#160;&#160; closeOnEscape:true,<br />&#160;&#160;&#160; &#160;&#160;&#160; <br />&#160;&#160;&#160; } // search options<br />&#160;&#160;&#160; );</p>
</p>
<p>and this the reload (where curr_RaceID is an integer param set):</p>
</p>
<p>&#160;&#160;&#160; &#160;&#160;&#160; $("#grid_rm_search").setGridParam({<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; url:&#39;php/race_resultssearch.php?r=&#39; + curr_RaceID<br />&#160;&#160;&#160; &#160;&#160;&#160; }).trigger("reloadGrid");</p>
<p>Thanks again</p>
<p>Regards</p>
<p>Romyn</p></p>
]]></description>
        	        	<pubDate>Fri, 30 Oct 2009 20:10:28 +0200</pubDate>
        </item>
        <item>
        	<title>tony on A few questions about Search</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/a-few-questions-about-search#p11284</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/a-few-questions-about-search#p11284</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>1. <a rel="nofollow" href="/jqgridwiki/doku.php?id=wiki:search_config" target="_blank"></a><a href="http://www.trirand.com/jqgridw" rel="nofollow" target="_blank">http://www.trirand.com/jqgridw</a>.....rch_config</p>
<p>caption can be set in the method.</p>
<p>2. in the search method options you can (I never try this, but it should work) :</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit5895' value='Select Code' data-codeid='sfcode5895' /></p>
<div class='sfcode' id='sfcode5895'>
<p>$(&#8221;#mygrid&#8221;).searchGrid( {</p>
<p>onInitializeSearch : function (formid) {</p>
<p>$(&#8221;.fields select&#8221;,formid).val(&#8221;myname&#8221;);</p>
<p>// where myname is the index (or the name) from colModel</p>
<p>}</p>
<p>});</p>
</div>
<p>3.&#160; $(&#8221;#mygrid&#8221;).navGrid(&#8221;#pager&#8221;,{serarch:false});</p>
<p><a rel="nofollow" href="/jqgridwiki/doku.php?id=wiki:navigator" target="_blank"></a><a href="http://www.trirand.com/jqgridw" rel="nofollow" target="_blank">http://www.trirand.com/jqgridw</a>.....:navigator</p>
<p>4.&#160; Not sure. Check what is your server response if you load the grid for first time. Maybe there are missed things</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Fri, 30 Oct 2009 07:17:26 +0200</pubDate>
        </item>
        <item>
        	<title>Romyn on A few questions about Search</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/a-few-questions-about-search#p11162</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/a-few-questions-about-search#p11162</guid>
        	        	<description><![CDATA[<p>Hi,</p>
</p>
<p>I&#39;m using the Advanced Search feature (although this applies to simple search also) and have a few of questions that I&#39;d apprecaite a bit of help with.</p>
</p>
<p>1. Is there any way - except changing within the locale js file - the caption you get on the Search pop-up (Search...)?. It seems to say in the wiki that it&#39;s set in the locale but I was wondering if there&#39;s another way to do it.</p>
</p>
<p>2. When the Search pop-up appears is there any way to set the default search field to, say, the third one listed. At the moment the drop-down lists the searchable fields in column order and defaults to the first one. The order I have my columns is logical for one reason or another but it would be handy to default the index of the dropdown list to something other than the first one listed.</p>
</p>
<p>3. I have a pager but can&#39;t work out how to remove the Search icon from it. I&#39;m using a Toolbar with a bespoke icon so I&#39;d prefer to only be able to access the Search pop-up with that - so as not to potentially confuse people. I&#39;m sure this is simple and in the docs somewhere but I just can&#39;t find it - sorry.</p>
</p>
<p>4. This may be a bug - I&#39;m not sure - but which I first load my grid I have a couple of pages (view records shows the record count) but the page forward/backward buttons don&#39;t work/not enabled. If I open the Search pop-up and just click reset and close the buttons become enabled and work as expected. Any ideas what I might be doing wrong?</p>
</p>
<p>Sorry this is such a shopping list but I thought it better to put them all into one post. Thanks for getting this far and any help/pointers will, as always, be greatly appreciated.</p>
</p>
<p>Mucho thanks in advance</p>
<p>Regards</p>
<p>Romyn</p>
]]></description>
        	        	<pubDate>Wed, 28 Oct 2009 02:21:45 +0200</pubDate>
        </item>
</channel>
</rss>