<?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: Allow beforeEditCell to abort edits</title>
	<link>http://www.trirand.com/blog/?page_id=393/feature-request/allow-beforeeditcell-to-abort-edits</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/allow-beforeeditcell-to-abort-edits/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>zchermit on Allow beforeEditCell to abort edits</title>
        	<link>http://www.trirand.com/blog/?page_id=393/feature-request/allow-beforeeditcell-to-abort-edits#p4017</link>
        	<category>Feature Request</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/feature-request/allow-beforeeditcell-to-abort-edits#p4017</guid>
        	        	<description><![CDATA[<p>Hi, Zupert, Pat and Tony!!</p>
<p>I also wanted to prohibit the editing of individual cells rather than the column immediately.</p>
<p> If you have managed styles for each cell (such as in the post <a href="http://www.trirand.com/blog/?page_id=18/feature-request/custom-cell-class/page-1/post-4015/#p4015" target="_blank">Custom Cell Class</a>) this could be quite simple: just check for class â€œreadonlyâ€ in cell:</p>
<p>@@ -1351,6 +1360,7 @@<br />Â Â Â Â  Â Â Â  Â Â Â  td = (e.target &#124;&#124; e.srcElement);<br />Â Â Â Â  Â Â Â  Â Â Â  if (td.href) { return true; }<br />Â Â Â Â  Â Â Â  Â Â Â  var scb = $(td).hasClass(â€cboxâ€);<br />+Â Â Â  Â Â Â  Â Â Â  var ro = !$(td).hasClass(â€readonlyâ€);<br />Â Â Â Â  Â Â Â  Â Â Â  ptr = $(td,ts.rows).parent(â€trâ€);<br />Â Â Â Â  Â Â Â  Â Â Â  if($(ptr).length === 0 ){<br />Â Â Â Â  Â Â Â  Â Â Â  Â Â Â  ptr = $(td,ts.rows).parents(â€tr:firstâ€);<br />@@ -1365,7 +1375,7 @@<br />Â Â Â Â  Â Â Â  Â Â Â  Â Â Â  Â Â Â  } else {<br />Â Â Â Â  Â Â Â  Â Â Â  Â Â Â  Â Â Â  Â Â Â  ri = ptr[0].rowIndex;<br />Â Â Â Â  Â Â Â  Â Â Â  Â Â Â  Â Â Â  Â Â Â  ci = td.cellIndex;<br />-Â Â Â  Â Â Â  Â Â Â  Â Â Â  Â Â Â  Â Â Â  try {$(ts).editCell(ri,ci,true,true);} catch (e) {}<br />+Â Â Â  Â Â Â  Â Â Â  Â Â Â  Â Â Â  Â Â Â  try {$(ts).editCell(ri,ci,ro,true);} catch (e) {}<br />Â Â Â Â  Â Â Â  Â Â Â  Â Â Â  Â Â Â  }<br />Â Â Â Â  Â Â Â  Â Â Â  Â Â Â  } else if ( !ts.p.multikey ) {<br />Â Â Â Â  Â Â Â  Â Â Â  Â Â Â  Â Â Â  if(ts.p.multiselect &#38;&#38; ts.p.multiboxonly) {</p>
<p>Regards,</p>
<p>Serg.</p>
]]></description>
        	        	<pubDate>Sun, 18 Jan 2009 15:31:46 +0200</pubDate>
        </item>
        <item>
        	<title>zupert on Allow beforeEditCell to abort edits</title>
        	<link>http://www.trirand.com/blog/?page_id=393/feature-request/allow-beforeeditcell-to-abort-edits#p2772</link>
        	<category>Feature Request</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/feature-request/allow-beforeeditcell-to-abort-edits#p2772</guid>
        	        	<description><![CDATA[<p>Hi pat and tony,</p>
<p>I met the same problem, and modified the source of grid.celledit.js the following way to meet those requirements.</p>
<p>Here my modifications, at line 72 and following. The principe is just adding a var to receive the value and being able to test it.</p>
<p>Greetings,</p>
<p>zupert</p>
<p>Code :</p>
</p>
<pre><code>
var followEdit = true;
if ($.isFunction($t.p.beforeEditCell)) {
	followEdit = $t.p.beforeEditCell($t.rows[iRow].id,nm,tmp,iRow,iCol);
}
if (followEdit !== false) {
	$(cc).html("").append(elc);
	window.setTimeout(function () { $(elc).focus();},0);
	$t.p.savedRow.push({id:iRow,ic:iCol,name:nm,v:tmp});
	$("input, select, textarea",cc).bind("keydown",function(e) { 
		if (e.keyCode === 27) {$($t).restoreCell(iRow,iCol);} //ESC
		if (e.keyCode === 13) {$($t).saveCell(iRow,iCol);}//Enter
		if (e.keyCode == 9)  {$($t).nextCell(iRow,iCol);} //Tab
		e.stopPropagation();
	});
	if ($.isFunction($t.p.afterEditCell)) {
		$t.p.afterEditCell($t.rows[iRow].id,nm,tmp,iRow,iCol);
	}
}

</code></pre>
]]></description>
        	        	<pubDate>Wed, 29 Oct 2008 08:05:12 +0200</pubDate>
        </item>
        <item>
        	<title>pat on Allow beforeEditCell to abort edits</title>
        	<link>http://www.trirand.com/blog/?page_id=393/feature-request/allow-beforeeditcell-to-abort-edits#p2727</link>
        	<category>Feature Request</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/feature-request/allow-beforeeditcell-to-abort-edits#p2727</guid>
        	        	<description><![CDATA[<p>Allow beforeEditCell to abort edits by returning false. Since editing is turned on for an entire column, this would allow finer grained control.</p>
]]></description>
        	        	<pubDate>Tue, 28 Oct 2008 08:37:59 +0200</pubDate>
        </item>
</channel>
</rss>