<?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: Change Search UI Column Default Selection</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/change-search-ui-column-default-selection</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/change-search-ui-column-default-selection/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>pommygranite on Change Search UI Column Default Selection</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/change-search-ui-column-default-selection#p29645</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/change-search-ui-column-default-selection#p29645</guid>
        	        	<description><![CDATA[<p>Since there doesn&#39;t appear to be an easy way to change the default column listbox selection, i&#39;ve implemented some convoluted code which does it:</p>
<pre>    var&#160;change_search_now&#160;=&#160;false;
</pre>
<pre>&#160;&#160;&#160;&#160;//&#160;Change&#160;serach&#160;default&#160;from&#160;selection&#160;option&#160;to the one with value = &#39;3&#39;
&#160;&#160;&#160; function&#160;changeSearchDefault(select){
&#160;&#160;&#160;&#160;&#160;&#160;select.children("option:selected").removeAttr("selected");
&#160;&#160;&#160;&#160;&#160;&#160;var&#160;newdefault&#160;=&#160;select.children("option[value=&#39;3&#39;]");
&#160;&#160;&#160;&#160;&#160;&#160;newdefault.attr("selected",&#160;"selected");
&#160;&#160;&#160;&#160;&#160;&#160;newdefault.trigger("change");
&#160;&#160;&#160;&#160;}
<br />And in the jqGrid navGrid initialization:</pre>
<pre>&#160;&#160;&#160; onInitializeSearch:&#160;function(){
&#160;&#160;&#160;&#160;&#160; change_search_now&#160;=&#160;true;
&#160;&#160;&#160;&#160;&#160; changeSearchDefault($(&#39;.columns&#39;).children("select"));
&#160;&#160;&#160;&#160;&#160; $("#fbox_grid_main_reset").click(function(){
&#160;&#160;&#160;&#160;&#160;&#160;&#160; change_search_now&#160;=&#160;true;
&#160;&#160;&#160;&#160;&#160; });
&#160;&#160;&#160; },
&#160;&#160;&#160; afterRedraw:&#160;function(){
&#160;&#160;&#160;&#160;&#160; if&#160;(change_search_now){
&#160;&#160;&#160;&#160;&#160;&#160;&#160; changeSearchDefault($(&#39;.columns&#39;).children("select"));
&#160;&#160;&#160;&#160;&#160;&#160;&#160; change_search_now&#160;=&#160;false;
&#160;&#160;&#160;&#160;&#160; }
&#160;&#160;&#160;&#160;&#160; //&#160;Add&#160;"+"&#160;button&#160;click&#160;handlers&#160;to&#160;change&#160;search&#160;column&#160;default&#160;of&#160;newest&#160;search&#160;row&#160;item
&#160;&#160;&#160;&#160;&#160; $("input[value=&#39;+&#39;]").each(function(inputindex){
&#160;&#160;&#160;&#160;&#160;&#160;&#160; $(this).click(function(){
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $("input[value=&#39;+&#39;]").each(function(clickedindex){
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if&#160;(clickedindex&#160;==&#160;inputindex){
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; //&#160;Change&#160;default
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; changeSearchDefault($(this).closest(&#39;tr&#39;).siblings(":last").children(".columns").children("select"));
&#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; },

</pre>
]]></description>
        	        	<pubDate>Wed, 09 Oct 2013 17:21:38 +0300</pubDate>
        </item>
        <item>
        	<title>pommygranite on Change Search UI Column Default Selection</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/change-search-ui-column-default-selection#p29644</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/change-search-ui-column-default-selection#p29644</guid>
        	        	<description><![CDATA[<p>When the search window is opened, there is a dropdown to select the column to search.&#160; The order of the columns in the dropdown corresponds to the order of the columns in the grid.&#160; This is fine, but the default selection is the first column.&#160; 99.9% of the time, my users will change the column dropdown to the 3rd column.&#160; It would be more efficient if I could change the default dropdown selection to the 3rd column.&#160; How can I do this?&#160;</p>
]]></description>
        	        	<pubDate>Wed, 09 Oct 2013 14:41:46 +0300</pubDate>
        </item>
</channel>
</rss>