<?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: Disable checkbox on selected rows</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/disable-checkbox-on-selected-rows</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/help/disable-checkbox-on-selected-rows/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>Pete on Disable checkbox on selected rows</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/disable-checkbox-on-selected-rows#p29414</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/disable-checkbox-on-selected-rows#p29414</guid>
        	        	<description><![CDATA[<p>I have searched and tried mutiple approaches to what I thought was a simple &#160;issue. &#160;I have a grid that has only one editable column and that is a checkbox. &#160;There are a few records that I don&#39;t want a user to be able to change so I used the following code:</p>
</p>
<p>afterInsertRow: function(rid,rdata,relem){&#160; &#160; &#160; &#160;&#160;</p>
<p><span style="white-space: pre;"> </span>&#160;if(rdata.position==&#39;this&#39; &#124;&#124; rdata.position==&#39;that&#39;)</p>
<p><span style="white-space: pre;"> </span>$(&#39;#&#39;+rid+&#39;_myCellName&#39;).attr(&#39;disabled&#39;,true);</p>
<p>},</p>
</p>
<p>No joy. &#160;The checkbox remains enabled and can be checked on and off.</p>
</p>
<p>I thought maybe this would work in the colModel:</p>
<p>{ name: &#39;myCellName&#39;, &#160;index: &#39;myCellName&#39;, editable:false, edittype:&#39;checkbox&#39;, editoptions: { value:&#39;true:false&#39;}, formatter: &#39;checkbox&#39;, formatoptions: {disabled : evalCheckBoxStatus()},width:60},</p>
</p>
<p>but I can&#39;t figure out how to get the rowID passed to the evalCheckBoxStatus() function.</p>
</p>
<p>I was not sure that I was getting a valid cell reference using the $(&#39;#&#39;+rid+&#39;_myCellName&#39;).attr(&#39;disabled&#39;,true); selectior syntax in the afterInsertRow function call but if I do this:</p>
</p>
<p>var cellRef = $(&#39;#&#39;+rid+&#39;_myCellName&#39;);</p>
</p>
<p>I DO get a valid object reference (but I am not sure if it is valid for what I want to use it for). &#160;</p>
</p>
<p>I have also tried a selector like this: &#160;var cbcell1 = $("input[id=&#39;#"+rid+"_myCellName&#39;][type=&#39;checkbox&#39;]");</p>
<p>but I still can&#39;t set the disabled attribute.</p>
</p>
<p>So, what am I missing? &#160;This seems like it should be easy but apparently I am missing something essential&#8230;..I am using jQuery 1.9.1 and jqGrid 4.5.2.</p></p>
]]></description>
        	        	<pubDate>Wed, 28 Aug 2013 19:16:17 +0300</pubDate>
        </item>
</channel>
</rss>