<?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: multiselect checks box when you click on any part of the row</title>
	<link>http://www.trirand.com/blog/?page_id=393/bugs/multiselect-checks-box-when-you-click-on-any-part-of-the-row</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/multiselect-checks-box-when-you-click-on-any-part-of-the-row/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tony on multiselect checks box when you click on any part of the row</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/multiselect-checks-box-when-you-click-on-any-part-of-the-row#p27221</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/multiselect-checks-box-when-you-click-on-any-part-of-the-row#p27221</guid>
        	        	<description><![CDATA[]]></description>
        	        	<pubDate>Wed, 29 Aug 2012 08:09:00 +0300</pubDate>
        </item>
        <item>
        	<title>Raif on multiselect checks box when you click on any part of the row</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/multiselect-checks-box-when-you-click-on-any-part-of-the-row#p27220</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/multiselect-checks-box-when-you-click-on-any-part-of-the-row#p27220</guid>
        	        	<description><![CDATA[<p>Well, not much interest in this feature I guess, but I&#39;m still interested.&#160; I found, perhaps, a better way to do this that doesn&#39;t break the selarrow array.&#160; scratch what I have above and do this.&#160; Inside of the setSelection method ~ 2645</p>
<p>if(!$t.p.multiselectoncheckboxonly ){<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if ( ia === -1){<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if(pt.className !== "ui-subgrid") { $(pt).addClass("ui-state-highlight").attr("aria-selected","true");}<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; stat = true;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $t.p.selarrrow.push($t.p.selrow);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; } else {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if(pt.className !== "ui-subgrid") { $(pt).removeClass("ui-state-highlight").attr("aria-selected","false");}<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; stat = false;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $t.p.selarrrow.splice(ia,1);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; tpsr = $t.p.selarrrow[0];<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $t.p.selrow = (tpsr === undefined) ? null : tpsr;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $("#jqg_"+$.jgrid.jqID($t.p.id)+"_"+$.jgrid.jqID(pt.id))[$t.p.useProp ? &#39;prop&#39;: &#39;attr&#39;]("checked",stat);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }else if($(e.target).hasClass("cbox")){<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if ( ia === -1){<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; stat = true;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $t.p.selarrrow.push($t.p.selrow);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }else{<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; stat = false;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $t.p.selarrrow.splice(ia,1);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $("#jqg_"+$.jgrid.jqID($t.p.id)+"_"+$.jgrid.jqID(pt.id))[$t.p.useProp ? &#39;prop&#39;: &#39;attr&#39;]("checked",stat);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p>
<p>basically what this does is if you have the prop multiselectoncheckboxonly set to true, then you can&#39;t set rows as "visually" selected.&#160; if you want the rows visually selected as well as checked then add the line</p>
<p>if(pt.className !== "ui-subgrid") { $(pt).addClass("ui-state-highlight").attr("aria-selected","true");}</p>
<p>and it&#39;s counter part, to the bottom part.</p>
<p>All I&#39;m doing is wrapping the top part which is already part of the source in the if else clause and providing the multiselectoncheckboxonly functionality in the second part.&#160; Also I don&#39;t have any "frozen" columns so if you do you might have to mess with the next few lines as well.</p>
<p>r</p>
]]></description>
        	        	<pubDate>Tue, 28 Aug 2012 22:53:07 +0300</pubDate>
        </item>
        <item>
        	<title>Raif on multiselect checks box when you click on any part of the row</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/multiselect-checks-box-when-you-click-on-any-part-of-the-row#p26958</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/multiselect-checks-box-when-you-click-on-any-part-of-the-row#p26958</guid>
        	        	<description><![CDATA[<p>Hi, <br />If you have multiselect set to true then you get a checkbox column.&#160; However, if you click anywhere on the row it checks and unchecks the checkbox. &#160;<br />For me personally, and now for my employeer this is a real usability bug.&#160; If you have a link in any column then clicking on the link checks and unchecks the checkbox for that row.<br />So I fixed and am submitting my fix incase any one wants the same thing or you are interested in incorporating it into the codebase.<br />I&#39;m not entirely sure how to specify where the code is because suspect that the file is different for everyone based on what you select on download, but I will try.<br />I guess the method is a click event on the row.&#160; In my jquery.jqGrid.src.js it&#39;s line 2385<br />$(ts).before(grid.hDiv).click(function(e) {<br />then a ways down you have</p>
<p>in this code scb true if the target of the event was the checkbox</p>
<p>} else if ( !ts.p.multikey ) {<br />&#160;&#160;&#160; if(ts.p.multiselect &#38;&#38; ts.p.multiboxonly) {<br />&#160;&#160;&#160;&#160;&#160; // this is good.&#160; This is the one we want<br />&#160;&#160;&#160;&#160;&#160; if(scb){$(ts).jqGrid("setSelection",ri,true,e);}<br />&#160;&#160;&#160;&#160;&#160; else {<br />&#160;&#160;&#160;&#160;&#160;&#160; ....<br />&#160;&#160;&#160;&#160;&#160;&#160; frozen column code <br />&#160;&#160;&#160;&#160;&#160;&#160; ....<br />&#160;&#160;&#160;&#160;&#160;&#160; // this is bad, this one says even if you did not click on the checkbox<br />&#160;&#160;&#160;&#160;&#160;&#160; // still select the row.<br />&#160;&#160;&#160;&#160;&#160;&#160; $(ts).jqGrid("setSelection",ri,true,e);<br />&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160; } else {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; // this one is the same as the one above.<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $(ts).jqGrid("setSelection",ri,true,e);<br />&#160;&#160;&#160; }<br />&#160;&#160; &#160;<br />&#160;&#160;&#160; so what I did was change it to <br />&#160;&#160; &#160;<br />} else if ( !ts.p.multikey ) {<br />&#160;&#160;&#160; if(ts.p.multiselect &#38;&#38; ts.p.multiboxonly) {<br />&#160;&#160;&#160;&#160;&#160; // this is good.&#160; This is the one we want<br />&#160;&#160;&#160;&#160;&#160; if(scb){$(ts).jqGrid("setSelection",ri,true,e);}<br />&#160;&#160;&#160;&#160;&#160; else {<br />&#160;&#160;&#160;&#160;&#160; ....<br />&#160;&#160;&#160;&#160;&#160;&#160; frozen column code <br />&#160;&#160;&#160;&#160;&#160; ....<br />&#160;&#160;&#160;&#160;&#160; if(!ts.p.multiselectoncheckboxonly){<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $(ts).jqGrid("setSelection",ri,true,e);<br />&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160; }<br />&#160; } else if(!ts.p.multiselectoncheckboxonly){<br />&#160;&#160;&#160; $(ts).jqGrid("setSelection",ri,true,e);<br />&#160; }<br />}</p>
<p>then in the gridoptions that pass in to the grid I simply set multiselectoncheckboxonly:true,<br />if you are using some other stuff like the multikey or maybe editing you may have to dig deeper, but this gets me where I need to be.<br />Raif</p>
]]></description>
        	        	<pubDate>Tue, 17 Jul 2012 22:14:57 +0300</pubDate>
        </item>
</channel>
</rss>