<?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: Reset Search Value does not always work</title>
	<link>http://www.trirand.com/blog/?page_id=393/bugs/reset-search-value-does-not-always-work</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/bugs/reset-search-value-does-not-always-work/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>houssem on Reset Search Value does not always work</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/reset-search-value-does-not-always-work#p30971</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/reset-search-value-does-not-always-work#p30971</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>I'm using jqGird 4.6.0 with the filter toolbar and sortableÂ columns enabled.<br />
I put a filter value on a text typeÂ column, I drag that column into the place of a select type column, I click on Reset Search Value for my text, and it does not work.</p>
<p>Bug details.Â jquery.jqGrid.src.jsÂ line 4495:</p>
<p style="padding-left: 30px">$("td.ui-search-input select", ptr)[0].selectedIndex = 0;</p>
<p>There is no "selectedIndex" attribute for the selected element. This is because the element ($("td.ui-search-input select", ptr)[0]) is not of select type. That is because the index of the colModel (line 4491) still refers to the select type column instead of the textÂ type column that was moved there.<br />
The wrong column index is set on line 4488:</p>
<p style="padding-left: 30px">coli = parseInt($("td.ui-search-oper", ptr).attr('colindex'),10),</p>
<p>I don't have enough time to track why theÂ colindex attribute onÂ the DOM hasn't been updated when the column was reordered, so instead, I wrote a small fix that can be used to get the correct index independently from the field's colindex attribute. Replace line 4488 with:</p>
<p style="padding-left: 30px"><span style="background-color: inherit">coln = $("td.ui-search-input", ptr).attr('name'),<br />
coli = null;<br />
for (var i = 0; i &#60; $t.p.colModel.length; i++) {<br />
Â  Â  if ($t.p.colModel[i].index === coln) {<br />
Â  Â  Â  Â  coli = i;<br />
Â  Â  Â  Â  break;<br />
Â  Â  }<br />
}<br />
</span></p>
<p>This is the first bug report I do becauseÂ it messes up some events on my code and it's not cleanÂ to fix without touching jqGrid's source. Sorry if I'm not respecting any standards in this forum; this is my first post and it's in a hurry.</p>
<p>Houssem.</p>
]]></description>
        	        	<pubDate>Tue, 19 Aug 2014 17:18:44 +0300</pubDate>
        </item>
</channel>
</rss>