<?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: Error with keyIndex  when use subGrid</title>
	<link>http://www.trirand.com/blog/?page_id=393/bugs/error-with-keyindex-when-use-subgrid</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/error-with-keyindex-when-use-subgrid/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tony on Error with keyIndex  when use subGrid</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/error-with-keyindex-when-use-subgrid#p2942</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/error-with-keyindex-when-use-subgrid#p2942</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Thank you for this - you are right.</p>
<p>There is a more easy way to do that. Just move this piece of code</p>
<p>before adding the subgrid and multiselect columns in the</p>
<p>colModel</p>
</p>
<p>Regards</p>
<p>Tony</p></p>
]]></description>
        	        	<pubDate>Thu, 06 Nov 2008 01:40:48 +0200</pubDate>
        </item>
        <item>
        	<title>Sam Chrisp on Error with keyIndex  when use subGrid</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/error-with-keyindex-when-use-subgrid#p2921</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/error-with-keyindex-when-use-subgrid#p2921</guid>
        	        	<description><![CDATA[<p>Hi tony,</p>
<p>Are you sure this isn&#39;t a bug?</p>
<p>With the following configuration:</p>
<pre style="color:green; font-family:Courier;">jQuery("#mygrid").jqGrid({
	datatype: "json",
   	colNames:[&#39;#&#39;,&#39;Name&#39;],
   	colModel:[
   		{name:&#39;id&#39;,index:&#39;id&#39;, width:60, key:true},
   		{name:&#39;name&#39;,index:&#39;name&#39;, width:120}
	],
	subGrid: false,
	...
</pre>
<p>If subGrid is false, the &#39;id&#39; column will be the key column.</p>
<p>However, if subGrid is true, the &#39;name&#39; column will become the key column, which is not correct is it?</p>
<p>Modifying the code in <strong>grid.base.js</strong> (line 1147ff) with a decrement if subGrid is set resolves this:</p>
<pre style="color:green; font-family:Courier;">for (var i=0; i&#60;ts.p.colModel.length;i++) {
	if (ts.p.colModel[i].key===true) {
		if (ts.p.subGrid) i--;
		ts.p.keyIndex = i;
		break;
	}
}
</pre>
]]></description>
        	        	<pubDate>Tue, 04 Nov 2008 23:42:07 +0200</pubDate>
        </item>
        <item>
        	<title>tony on Error with keyIndex  when use subGrid</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/error-with-keyindex-when-use-subgrid#p2373</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/error-with-keyindex-when-use-subgrid#p2373</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>This is discussed before. It is not a bug. If you look into the code above this fragment you will find the answer. The subgrid column is added before this.</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Tue, 07 Oct 2008 08:45:38 +0300</pubDate>
        </item>
        <item>
        	<title>vatman on Error with keyIndex  when use subGrid</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/error-with-keyindex-when-use-subgrid#p2366</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/error-with-keyindex-when-use-subgrid#p2366</guid>
        	        	<description><![CDATA[<p>when&#160; use subGrid: true</p>
<p>incorrect calculate parametr <span class="sourceRowText">keyIndex (order number of fields with "key: true")</span></p>
<p>Reason:&#160;</p>
<p>look code. If "subGrid: true" then first element in <span class="sourceRowText">ts.p.colModel is cell for subgrid. and </span><span class="sourceRowText">keyIndex will set more for one.&#160; <br /></span></p>
<p><span class="sourceRowText">for (var i=0; i&#60;ts.p.colModel.length;i++) { </span></p>
<p><span class="sourceRowText">if (ts.p.colModel[i].key===true) { </span><span class="sourceRowText">ts.p.keyIndex = i;</span></p>
<div class="sourceRow"><a class="sourceLine" target="_blank"></a><span class="sourceRowText">break;</span><span class="sourceRowText">}</span><span class="sourceRowText">}</span></div>
<div class="sourceRow"></div>
<div class="sourceRow"></div>
<div class="sourceRow">Thank you. </div>
]]></description>
        	        	<pubDate>Tue, 07 Oct 2008 04:15:40 +0300</pubDate>
        </item>
</channel>
</rss>