<?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: More control over click/select behavior</title>
	<link>http://www.trirand.com/blog/?page_id=393/feature-request/more-control-over-clickselect-behavior</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/feature-request/more-control-over-clickselect-behavior/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tony on More control over click/select behavior</title>
        	<link>http://www.trirand.com/blog/?page_id=393/feature-request/more-control-over-clickselect-behavior#p9145</link>
        	<category>Feature Request</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/feature-request/more-control-over-clickselect-behavior#p9145</guid>
        	        	<description><![CDATA[<p>Hello Mark,</p>
<p>Thanks. As usual good catch - also added the event object to&#160; beforeSelectRow event.</p>
<p>Best Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Mon, 31 Aug 2009 11:21:48 +0300</pubDate>
        </item>
        <item>
        	<title>markw65 on More control over click/select behavior</title>
        	<link>http://www.trirand.com/blog/?page_id=393/feature-request/more-control-over-clickselect-behavior#p8968</link>
        	<category>Feature Request</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/feature-request/more-control-over-clickselect-behavior#p8968</guid>
        	        	<description><![CDATA[<p>In case anyone tries to use it, the return condition should be:</p>
</p>
<p>if (!ptr.length &#124;&#124; (td.tagName == &#39;INPUT&#39; &#38;&#38; !scb) &#124;&#124; td.tagName == &#39;A&#39;) {<br /> return true;<br /> }</p>
</p>
<p>Mark</p></p>
]]></description>
        	        	<pubDate>Wed, 26 Aug 2009 00:07:33 +0300</pubDate>
        </item>
        <item>
        	<title>markw65 on More control over click/select behavior</title>
        	<link>http://www.trirand.com/blog/?page_id=393/feature-request/more-control-over-clickselect-behavior#p8961</link>
        	<category>Feature Request</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/feature-request/more-control-over-clickselect-behavior#p8961</guid>
        	        	<description><![CDATA[<p>So following up to my own post... after studying the grid code I found a way to do it - although its something of a hack, and rather fragile.</p>
</p>
<p>If beforeSelectRow could be passed the event object, and the column ix, I think I could do everything I want without any trickery.</p>
</p>
<p>For anyone else interested in a grid that supports shift-click to select ranges, ctrl-click to toggle rows, and handles clicks on editable fields smartly, the code follows. To use it set "multiselect:true,beforeSelectRow:function(){return false;}" in the grid options, and then add the handler as follows:</p>
</p>
<p>$(mygrid).bind("click",$(mygrid),multiSelectHandler);</p>
</p>
<p>where multiselectHandler is:</p>
</p>
<p>function multiSelectHandler(e) {<br /> var grid = e.data;<br /> var ts = grid[0], td = e.target;<br /> var scb = $(td).hasClass("cbox");<br /> var ptr = $(td).parents("tr.jqgrow");<br /> if (!ptr.length &#124;&#124; td.tagName == &#39;INPUT&#39; &#124;&#124; td.tagName == &#39;A&#39;) {<br /> return true;<br /> }<br /> var sel = grid.getGridParam(&#39;selarrrow&#39;);<br /> var sid = ptr[0].id;<br /> var selected = $.inArray(sid, sel) &#62;= 0;<br /> if (e.ctrlKey &#124;&#124; (scb &#38;&#38; (selected &#124;&#124; !e.shiftKey))) {<br /> grid.setSelection(false,true,ptr);<br /> } else {<br /> if (e.shiftKey) {<br /> var six = grid.getInd( sid);<br /> var min = six, max = six;<br /> $.each(sel, function() {<br /> var ix = grid.getInd( this);<br /> if (ix &#60; min) min = ix;<br /> if (ix &#62; max) max = ix;<br /> });<br /> while (min &#60;= max) {<br /> var row = ts.rows[min++];<br /> var rid = row.id;<br /> if (rid != sid &#38;&#38; $.inArray(rid, sel)&#60;0) {<br /> grid.setSelection( false, false, $(row));<br /> }<br /> }<br /> } else if (!selected) {<br /> grid.resetSelection();<br /> }<br /> if (!selected) {<br /> grid.setSelection( false, true, ptr);<br /> } else {<br /> var osr = grid.getGridParam(&#39;onSelectRow&#39;);<br /> if ($.isFunction(osr)) {<br /> osr(sid, true);<br /> }<br /> }<br /> }<br /> }</p></p>
]]></description>
        	        	<pubDate>Tue, 25 Aug 2009 15:43:50 +0300</pubDate>
        </item>
        <item>
        	<title>markw65 on More control over click/select behavior</title>
        	<link>http://www.trirand.com/blog/?page_id=393/feature-request/more-control-over-clickselect-behavior#p8958</link>
        	<category>Feature Request</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/feature-request/more-control-over-clickselect-behavior#p8958</guid>
        	        	<description><![CDATA[<p>i) beforeSelectRow doesnt have enough information passed to it. eg, I have an inline-editable multi-select grid:</p>
<ul>
<li>If the user clicks on an editable field of a selected row, I want to start editing (not deselect the row, as would happen with a multiselect grid)</li>
<li>If the user clicks on a field thats already being edited, I dont want the normal select operations to happen at all (the &#60;input&#62; element will handle the click for me).</li>
<li>If the user clicks on the checkbox of a row thats being edited, I want to deselect the row, and finish the edit.</li>
</ul>
<p>To acheive this, getting the event would help, as would getting the column.</p>
</p>
<p>ii) multiselect grids cant customize select behavior enough. I need to be able to customize:</p>
<ul>
<li>click on row</li>
<li>click on checkbox</li>
<li>shift click on row</li>
<li>shift click on checkbox</li>
<li>ctrl click on row</li>
<li>ctrl click on checkbox</li>
</ul>
<p>All in the same grid!</p></p>
]]></description>
        	        	<pubDate>Tue, 25 Aug 2009 11:48:32 +0300</pubDate>
        </item>
</channel>
</rss>