<?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: Deslect Row "feature Introduced in 3.8 is actually a bug</title>
	<link>http://www.trirand.com/blog/?page_id=393/bugs/deslect-row-feature-introduced-in-3-8-is-actually-a-bug</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/deslect-row-feature-introduced-in-3-8-is-actually-a-bug/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>Professa Dementia on Deslect Row "feature Introduced in 3.8 is actually a bug</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/deslect-row-feature-introduced-in-3-8-is-actually-a-bug#p22728</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/deslect-row-feature-introduced-in-3-8-is-actually-a-bug#p22728</guid>
        	        	<description><![CDATA[<p>I will try this.&#160; Thanks for the fast response.</p>
]]></description>
        	        	<pubDate>Mon, 11 Apr 2011 11:20:56 +0300</pubDate>
        </item>
        <item>
        	<title>tony on Deslect Row "feature Introduced in 3.8 is actually a bug</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/deslect-row-feature-introduced-in-3-8-is-actually-a-bug#p22726</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/deslect-row-feature-introduced-in-3-8-is-actually-a-bug#p22726</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Thank you for the recommendation.</p>
<p>Actually from this point our goal is not to add additional options into the grid.</p>
<p>The reason is simple. The grid has a thausand of options and sometime I can not remmember all.</p>
<p>You understand what I mean.</p>
<p>For this purpose to have deleseleced row&#160; (When this was introduced a lot of people say why you have a row deselection? This brake my applicatrion! and etc)</p>
<p>I have introduced a id parameter in resetSelection method.</p>
</p>
<p>The appropriate code is</p>
<p><input type='button' class='sfcodeselect' name='sfselectit1052' value='Select Code' data-codeid='sfcode1052' /></p>
<div class='sfcode' id='sfcode1052'>
<p>onSlectRow : function( id, selected)</p>
<p>{</p>
<p>if(selected === false) { $(&#34;#grid&#34;).resetSelection( id); }</p>
<p>}</p>
</div>
<p>This way everybody is happy</p>
<p>1. jqGrid team &#8211; there are no more additional options</p>
<p>2. You &#8211; you have a single line of code for deselection</p>
<p>3. All other that do not like the deselection.</p>
</p>
<p>Kind Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Mon, 11 Apr 2011 09:44:29 +0300</pubDate>
        </item>
        <item>
        	<title>Professa Dementia on Deslect Row "feature Introduced in 3.8 is actually a bug</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/deslect-row-feature-introduced-in-3-8-is-actually-a-bug#p22724</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/deslect-row-feature-introduced-in-3-8-is-actually-a-bug#p22724</guid>
        	        	<description><![CDATA[<p>The stated goal of Tony and the team is to maintain backward compatibility when adding features.&#160; This is normal and good practice.</p>
</p>
<p>In version 3.8, a "feature" was added to allow clicking on a selected row in NON-multiselect mode which would deselect that row.&#160; This is directly contrary to the prior feature that clicking on a selected row keeps it selected.&#160; The prior behavior is NOT a bug.</p>
</p>
<p>By changing this behavior you break backward compatibility.&#160; This new mode should require a flag to enable it.</p>
<p>Example-&#160;&#160; deselectWhenReselect: true;</p>
<p>The new feature is the one that should require the flag, since the old behavior did not require one and requiring a flag for the old behavior, also breaks backward compatibility.</p>
</p>
<p>I was using the prior behavior.&#160; When the user clicks a row, A) it highlights so the user has a visual indicator of which row they selected.&#160; Then, using OnSelectedRow, I open an overlay with information, much like a lightbox.&#160; When the user is done, they close the overlay, revealing the grid, once again, with the row they selected still highlighted, as a visual reference.&#160; All this happens automatically.&#160; However, information changes and the user may wish to select the same row again to open the overlay once more.</p>
</p>
<p>Before, in version 3.7, this worked.&#160; Now, the row deselects and the user gets nothing.&#160; They have to click a second time to get their overlay.&#160; For my project, this is bad human interface design, and frankly, annoying to the user.&#160; There is no way for me to override this behavior without actually changing the source code.</p>
</p>
<p>I can go back to version 3.7, but I upgraded to 3.8 because I wanted to start using the grouping function.&#160; So, now, I am faced with one of two options.</p>
<p>1) I can go back to version 3.7 and try to get by without any of the new features.</p>
<p>2) I can upgrade, but make custom changes to the code to get back the functionality I need.&#160; I have to remember and make these custom change from now on, everytime I upgrade, which, is definitely not good practice for code maintenance.</p>
</p>
<p>It is important to keep existing features in place and not disable them when adding new features.</p>
</p>
<p>The 3.7.2 code: from grid.base.js&#160; Lines 2347-2349</p>
<p>$t.p.selrow = pt.id;<br />$(pt).addClass("ui-state-highlight").attr("aria-selected","true");<br />if( $t.p.onSelectRow &#38;&#38; onsr) { $t.p.onSelectRow.call($t,$t.p.selrow, true); }</p>
</p>
<p>New faulty 3.8.2 code from grid.base.js&#160; Lines 2419-2423</p>
<p>if( $t.p.selrow != pt.id) {<br />&#160;&#160;&#160; $t.p.selrow = pt.id;<br />&#160;&#160;&#160; $(pt).addClass("ui-state-highlight").attr("aria-selected","true");<br />&#160;&#160;&#160; if( $t.p.onSelectRow &#38;&#38; onsr) { $t.p.onSelectRow.call($t,$t.p.selrow, true); }<br />} else {$t.p.selrow = null;}</p>
<p>The corrected code follows (this is untested):</p>
<p>if( $t.p.selrow != pt.id &#124;&#124; !$t.p.deselectWhenReselect) {<br />&#160;&#160;&#160; $t.p.selrow = pt.id;<br />&#160;&#160;&#160; $(pt).addClass("ui-state-highlight").attr("aria-selected","true");<br />&#160;&#160;&#160; if( $t.p.onSelectRow &#38;&#38; onsr) { $t.p.onSelectRow.call($t,$t.p.selrow, true); }<br />} else {$t.p.selrow = null;}</p>
</p>
<p>Add the following after line 633 (the line with multiselect: false,)</p>
<p>deselectWhenReselect: false,</p>
]]></description>
        	        	<pubDate>Mon, 11 Apr 2011 03:56:04 +0300</pubDate>
        </item>
</channel>
</rss>