<?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: Multisearch - restricting additional search criteria</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/multisearch-restricting-additional-search-criteria</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/multisearch-restricting-additional-search-criteria/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tony on Multisearch - restricting additional search criteria</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/multisearch-restricting-additional-search-criteria#p10925</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/multisearch-restricting-additional-search-criteria#p10925</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Thanks, will consider this feature.</p>
<p>Best Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Wed, 21 Oct 2009 05:11:05 +0300</pubDate>
        </item>
        <item>
        	<title>Arun on Multisearch - restricting additional search criteria</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/multisearch-restricting-additional-search-criteria#p10872</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/multisearch-restricting-additional-search-criteria#p10872</guid>
        	        	<description><![CDATA[<p>Hi Tony,</p>
<p>First, thanks for your reply and all the hard work put in to develop such a awesome tool.&#160; I was able to restrict the number of searches allowed in a multi-search option. I have modified the code to put a restriction to the maximum number of times the search row being added. Hope it might be useful to someone&#8230;.</p>
<p>Here is how I have done:</p>
<p>In JQGrid Version 3.5 &#8211; Advanced Searching option demo, you can have n number of search rows by clicking on &#39;+&#39;. </p>
<p>This has been modified as below, where you can restrict the number of search rows being added based on the <strong>maxMSCount</strong> defined. Once the search rows reaches the max count, it will not allow the user to add any more rows. <br />I have tried the way as explained below, which is working.</p>
<p>As a first step, I have defined a property &#39;<strong>maxMsCount</strong>&#39; (maximum multi search count), under multisearch options.<br />say for example: <strong>maxMsCount: 3</strong></p>
<p>This maxMsCount property value will be used to restrict the number of search rows being added by clicking on &#39;+&#39;.</p>
<p>In order to identify the number of search rows added, I have added an id (id=&#39;<strong>sf</strong>&#39;) to the tbody tag of &#60;div id=&#8221;fbox_list&#8221;.&#160; So that on every click on &#39;+&#39; (plus), I can get the count and restrict the number of search rows been added (here every search row is basically a tr tag).</p>
<p>The condition checked for restricting the search rows is would look like :<br />if (tr.size &#62; __maxMsCount) return; //just returns without adding the new search row</p>
<p>Where __maxMSCount holds the value of maxMsCount option which is defined under multisearch options.</p>
<p>STEPS TO IMPLEMENT THIS<br />1. The grid definition<br />jQuery(&#8221;#samplelist&#8221;).jqGrid({<br />&#160;&#160;&#160; &#160;&#160;&#160; url: &#39;&#8230;<br />&#160;&#160;&#160; &#160;&#160;&#160; .<br />&#160;&#160;&#160; &#160;&#160;&#160; .<br />&#160;&#160;&#160; &#160;&#160;&#160; }).navGrid(&#39;#navigatorBar&#39;,{edit:false,add:false,del:false},//nav options <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {},//edit options<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {},//add options<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {},//del options<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {multipleSearch:true,<strong>maxMsCount:3</strong>,&#8230;..}, //search options<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {} //view options<br />&#160;&#160;&#160; &#160;&#160;&#160; ); // End Of navGrid<br />});</p>
<p>2. The code modification required under <br />jquery.jqGrid.min.js</p>
<p>2.1 Added the below variable in the js file<br />var __maxMsCount=-1;</p>
<p>2.2 Then assigned the maxMsCount option value to __maxMsCount<br />__maxMsCount=(c.maxMsCount?c.maxMsCount:); //assignes if maxMsCount is defined </p>
<p>2.3 Then the condition to restrict the maxMsCount if maxMsCount property is present under search options.<br />if (__maxMsCount&#62;0){<br />&#160;&#160;&#160; if ($(&#39;<strong>#sf</strong> &#62; tr&#39;).size()&#62;__maxMsCount)return;<br />}<br />Where &#39;<strong>sf</strong>&#39; is the id of tbody tag, and $(&#39;#sf &#62; tr&#39;).size() gives the number of tr&#39;s under tbody tag.</p>
</p>
<p>Thanks and Regards</p>
<p>Arun</p>
]]></description>
        	        	<pubDate>Tue, 20 Oct 2009 05:47:13 +0300</pubDate>
        </item>
        <item>
        	<title>tony on Multisearch - restricting additional search criteria</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/multisearch-restricting-additional-search-criteria#p10447</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/multisearch-restricting-additional-search-criteria#p10447</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>5 times or 5 items - it is not the same</p>
<p>Both are not supported.</p>
<p>Reagrds</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Tue, 06 Oct 2009 06:19:30 +0300</pubDate>
        </item>
        <item>
        	<title>Arun on Multisearch - restricting additional search criteria</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/multisearch-restricting-additional-search-criteria#p10406</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/multisearch-restricting-additional-search-criteria#p10406</guid>
        	        	<description><![CDATA[</p>
<p>Hello,</p>
<p>I have included multisearch facility into the jqGrid. &#160;I would like to restrict the number of additional (search criteria) the user adds, say the maximum of 5 times. &#160;Is there a way to put a restriction?.</p>
<p>Please Help.</p>
<div></div>
<div>Arun</div>
]]></description>
        	        	<pubDate>Mon, 05 Oct 2009 06:41:00 +0300</pubDate>
        </item>
</channel>
</rss>