<?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: Make some rows readonly?</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/make-some-rows-readonly</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/make-some-rows-readonly/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>glittle on Make some rows readonly?</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/make-some-rows-readonly#p14715</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/make-some-rows-readonly#p14715</guid>
        	        	<description><![CDATA[<p>Thanks Tim.</p>
<p>(I posted my entry immediately after yours, and didn&#39;t see yours...)</p>
</p>
<p>This is what I have now, and it is working:</p>
<p>function GridComplete() {<br />&#160; var grid = $(&#39;#results&#39;);<br />&#160; var rowids = grid.getDataIDs();<br />&#160; var columnModels = grid.getGridParam().colModel;<br />&#160; <br />&#160; // check each visible row<br />&#160; for (var i = 0; i &#60; rowids.length; i++) {<br />&#160;&#160;&#160; var rowid = rowids[i];<br />&#160;&#160;&#160; var data = grid.getRowData(rowid);</p>
<p>&#160;&#160;&#160; if (data.AccessType == &#39;0&#39;) {&#160;&#160;&#160;&#160;&#160;&#160; // view only<br />&#160;&#160;&#160;&#160;&#160; // check each column<br />&#160;&#160;&#160;&#160;&#160; for (var j = 0; j &#60; columnModels.length; j++) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; var model = columnModels[j];<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (model.editable) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; grid.setCell(rowid, model.name, &#39;&#39;, &#39;not-editable-cell&#39;, {editable: false});<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160; }<br />&#160; }<br />}</p></p>
]]></description>
        	        	<pubDate>Thu, 11 Feb 2010 02:53:09 +0200</pubDate>
        </item>
        <item>
        	<title>tim on Make some rows readonly?</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/make-some-rows-readonly#p14664</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/make-some-rows-readonly#p14664</guid>
        	        	<description><![CDATA[<p>The first thing you should try is changing &#160;(readOnly == &#39;True&#39;)&#160;to use &#160;true without qoutes.</p>
<p>Outside that how come you&#39;re not trying the method I linked?:&#160;</p>
<p>beforeEditCell: function (rowid,name,val,iRow,iCol){<br />&#160;&#160;if (rowid == 1){</p>
<p>&#160;&#160; jQuery("#jqg_"+id,"#results").attr(&#39;editable&#39;,false);}},</p>
</p>
<p>If your looking for cell level changes I suggest:</p>
<p>$("#results").removeClass(&#39;edit-cell&#39;).setCell(rowid,&#39;columnname&#39;,&#39;&#39;,&#39;not-editable-cell&#39;);</p>
]]></description>
        	        	<pubDate>Wed, 10 Feb 2010 02:31:44 +0200</pubDate>
        </item>
        <item>
        	<title>glittle on Make some rows readonly?</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/make-some-rows-readonly#p14663</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/make-some-rows-readonly#p14663</guid>
        	        	<description><![CDATA[<p>Here&#39;s what I&#39;ve tried...</p>
</p>
<p>function BeforeCellEdit(rowid, cellname, value, iRow, iCol) {</p>
<p>&#160;&#160;&#160;&#160;&#160; var grid = $(&#39;#results&#39;);</p>
<p>&#160;&#160;&#160;&#160;&#160; window.status = rowid + &#39;-&#39; + cellname + &#39;-&#39; + value + &#39;-&#39; + iRow + &#39;-&#39; + iCol; // confirm the values being received</p>
<p>&#160;&#160;&#160;&#160;&#160; var readOnly = grid.getCell(rowid, 1);&#160; // hidden cell containing True or False for a read-only row</p>
<p>&#160;&#160;&#160;&#160;&#160; if (readOnly == &#39;True&#39;) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; grid.restoreCell(iRow, iCol);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; return false;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color: #800000;"> //TODO: this is not preventing edit</span><br /> &#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160; }</p>
</p>
<p>What else should be done?</p>
]]></description>
        	        	<pubDate>Wed, 10 Feb 2010 02:17:20 +0200</pubDate>
        </item>
        <item>
        	<title>tim on Make some rows readonly?</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/make-some-rows-readonly#p14662</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/make-some-rows-readonly#p14662</guid>
        	        	<description><![CDATA[<p>Here&#39;s an example...</p>
<p><a href="http://www.trirand.com/blog/?page_id=393/help/rowlock-using-beforeeditcell-is-losing-initial-value/&#038;value=rowlock&#038;type=1&#038;include=1&#038;search=1" rel="nofollow" target="_blank"><a href="http://www.trirand.com/blog/?p" rel="nofollow">http://www.trirand.com/blog/?p</a>.....8;search=1</a></p>
<p>tim</p>
]]></description>
        	        	<pubDate>Wed, 10 Feb 2010 02:11:08 +0200</pubDate>
        </item>
        <item>
        	<title>glittle on Make some rows readonly?</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/make-some-rows-readonly#p14661</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/make-some-rows-readonly#p14661</guid>
        	        	<description><![CDATA[<p>Hi,</p>
<p>Can anyone give any ideas for this?</p>
<p>Thanks,<br />Glen</p>
]]></description>
        	        	<pubDate>Wed, 10 Feb 2010 00:50:09 +0200</pubDate>
        </item>
        <item>
        	<title>glittle on Make some rows readonly?</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/make-some-rows-readonly#p14534</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/make-some-rows-readonly#p14534</guid>
        	        	<description><![CDATA[<p>In my grid, I have a number of columns marked as editable.</p>
<p>However, I need to make some of the rows being returned in the JSON to be readonly.</p>
<p>How can this be done?</p>
<p>Is there anything I can add to the JSON for those rows?</p>
<p>Can I iterate over the rows and set a flag to prevent editing on all the columns in that row?</p>
<p>Any other options?</p>
<p>Thanks,</p>
<p>Glen</p>
]]></description>
        	        	<pubDate>Wed, 03 Feb 2010 22:29:16 +0200</pubDate>
        </item>
</channel>
</rss>