<?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: Problem with key:true</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/problem-with-keytrue</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/problem-with-keytrue/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>Barry on Problem with key:true</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/problem-with-keytrue#p3108</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/problem-with-keytrue#p3108</guid>
        	        	<description><![CDATA[<p>I am working with a Grid with a Sub-Grid. I am doing in-line editing using the buttons in the first column. I&#39;m using the code from the example to populate the buttons on the client. Here is a cut n paste of the code:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit331' value='Select Code' data-codeid='sfcode331' /></p>
<div class='sfcode' id='sfcode331'>loadComplete: function(){<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160; var ids = jQuery("#grid1").getDataIDs(); <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; for(var i=0; i&#60;ids.length; i++){ <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; var cl = ids[i];<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; be = "&#60;input style=&#39;height:22px;width:20px;&#39; type=&#39;button&#39; value=&#39;E&#39; onclick=jQuery(&#39;#grid1&#39;).editRow("+cl+",true,pickdates); /&#62;";<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; se = "&#60;input style=&#39;height:22px;width:20px;&#39; type=&#39;button&#39; value=&#39;S&#39; onclick=jQuery(&#39;#grid1&#39;).saveRow("+cl+",null,null,{&#39;oper&#39;:&#39;edit&#39;}); /&#62;";<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; ce = "&#60;input style=&#39;height:22px;width:20px;&#39; type=&#39;button&#39; value=&#39;C&#39; onclick=jQuery(&#39;#grid1&#39;).restoreRow("+cl+"); /&#62;";<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; jQuery("#grid1").setRowData(ids[i],{act:be+se+ce})<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; } <br />&#160;&#160;&#160; &#160;&#160;&#160; }</div>
</p>
<p>What I am seeing is that when I set "key:true" in the colModel only the first row gets the buttons.</p>
<p>I added this alert inside the loop, alert(be+se+ce). I can see that a call is being made for each row. In fact the call is wrong. Instead of referencing the key column it references the column after the key column.</p>
<p><input type='button' class='sfcodeselect' name='sfselectit2984' value='Select Code' data-codeid='sfcode2984' /></p>
<div class='sfcode' id='sfcode2984'>colNames:[&#39;Actions&#39;,&#39;Match ID&#39;,&#39;Squad ID&#39;,&#39;Season ID&#39;,&#39;Squad&#39;,&#39;Season&#39;,&#39;Date&#39;,&#39;Opponent&#39;,&#39;Site&#39;],&#160;&#160; &#160;<br />&#160;&#160;&#160; colModel:[<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {name:&#39;act&#39;,index:&#39;act&#39;,width:70,sortable:false}, <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {name:&#39;match_id&#39;,index:&#39;match_id&#39;,hidden:true,width:55,key:false,editable:true,editoptions:{readonly:true,size:10}},<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;squad_id&#39;,index:&#39;squad_id&#39;,hidden:true,width:55,key:false,editable:true,editoptions:{readonly:true,size:10}},<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;season_id&#39;,index:&#39;season_id&#39;,hidden:true,width:55,key:false,editable:true,editoptions:{readonly:true,size:10}},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {name:&#39;squad&#39;,index:&#39;squad&#39;,width:90,editable:true,edittype:"select",editoptions:{&#60;?=$squad_list?&#62;}},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {name:&#39;season&#39;,index:&#39;season&#39;,width:100,editable:true,edittype:"select",editoptions:{&#60;?=$season_list?&#62;}},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {name:&#39;date&#39;,index:&#39;date&#39;, width:100, align:"right", editable:true,sorttype:"date"},&#160;&#160; &#160;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {name:&#39;opponent&#39;,index:&#39;opponent&#39;, width:150, align:"center", editable:true,editoptions:{size:50}},&#160;&#160; &#160;&#160;&#160; &#160;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {name:&#39;site&#39;,index:&#39;site&#39;, width:150,align:"center", editable:true,editoptions:{size:50}}&#160;&#160; &#160;<br />&#160;&#160;&#160; ],</div>
</p>
<p>Barry</p></p>
]]></description>
        	        	<pubDate>Sun, 16 Nov 2008 21:33:44 +0200</pubDate>
        </item>
</channel>
</rss>