<?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: "key:true" ignored / changing defined ID</title>
	<link>http://www.trirand.com/blog/?page_id=393/bugs/keytrue-ignored-changing-defined-id</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/keytrue-ignored-changing-defined-id/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tony on "key:true" ignored / changing defined ID</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/keytrue-ignored-changing-defined-id#p31251</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/keytrue-ignored-changing-defined-id#p31251</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Â </p>
<p>Can you please post your json response?</p>
<p>Do you have any changes in jsonReader?</p>
<p>The grid first search for key:true and then for the id from the response.</p>
<p>Â </p>
<p>Kind Regards</p>
]]></description>
        	        	<pubDate>Tue, 21 Oct 2014 16:37:38 +0300</pubDate>
        </item>
        <item>
        	<title>Desterly on "key:true" ignored / changing defined ID</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/keytrue-ignored-changing-defined-id#p31214</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/keytrue-ignored-changing-defined-id#p31214</guid>
        	        	<description><![CDATA[<p>Upgrading jqGrid from a build mid-april to latest github snapshot I ran into a small issue and I'm not sure where the problem lies.</p>
<p>Grid Defined as:</p>
<blockquote>
<p class="p1"><span class="Apple-converted-space">Â  Â  Â  Â  Â  Â  </span>$(<span class="s1">'#jqgReports'</span>).jqGrid({</p>
<p class="p2"><span class="s2"><span class="Apple-converted-space">Â  Â  Â  Â  Â  Â  Â  Â  </span></span>//url from wich data should be requested</p>
<p class="p1"><span class="Apple-converted-space">Â  Â  Â  Â  Â  Â  Â  Â  </span>url: <span class="s1">'</span><span class="s3">@</span>Url.Action(<span class="s1">"ReportAdminList"</span>)<span class="s1">'</span>,</p>
<p class="p2"><span class="s2"><span class="Apple-converted-space">Â  Â  Â  Â  Â  Â  Â  Â  </span></span>//url for inline edit</p>
<p class="p1"><span class="Apple-converted-space">Â  Â  Â  Â  Â  Â  Â  Â  </span>editurl: <span class="s1">'</span><span class="s3">@</span>Url.Action(<span class="s1">"ReportAdminEdit"</span>)<span class="s1">'</span>,</p>
<p class="p1"><span class="Apple-converted-space">Â  Â  Â  Â  Â  Â  Â  Â  </span>datatype: <span class="s1">'json'</span>,</p>
<p class="p2"><span class="s2"><span class="Apple-converted-space">Â  Â  Â  Â  Â  Â  Â  Â  </span></span>//url access method type</p>
<p class="p1"><span class="Apple-converted-space">Â  Â  Â  Â  Â  Â  Â  Â  </span>mtype: <span class="s1">'POST'</span>,</p>
<p class="p1"><span class="Apple-converted-space">Â  Â  Â  Â  Â  Â  Â  Â  </span><span class="s4">//columns names</span></p>
<p class="p3"><span class="s2"><span class="Apple-converted-space">Â  Â  Â  Â  Â  Â  Â  Â  </span>colNames: [</span>''<span class="s2">, </span>'ID'<span class="s2">, </span>'Title'<span class="s2">, </span>'List Description'<span class="s2">, </span>'Report Header'<span class="s2">, </span>'Report Footer'<span class="s2">, </span>'Year'<span class="s2">, </span>'NAICS'<span class="s2">, </span>'Org Code'<span class="s2">, </span>'Center'<span class="s2">, </span>'Enabled'<span class="s2">, </span>'Requires Data'<span class="s2">, </span>'Report Category'<span class="s2">, </span>'Rpt/App'<span class="s2">, </span>'Cover PDF file'<span class="s2">],</span></p>
<p class="p1"><span class="Apple-converted-space">Â  Â  Â  Â  Â  Â  Â  Â  </span><span class="s4">//columns model</span></p>
<p class="p1"><span class="Apple-converted-space">Â  Â  Â  Â  Â  Â  Â  Â  </span>colModel: [</p>
<p class="p1"><span class="Apple-converted-space">Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  </span>{ name: <span class="s1">'showlink'</span>, width: <span class="s1">'70'</span>, formatter: <span class="s1">'showlink'</span>, formatoptions: { baseLinkUrl: <span class="s1">'</span><span class="s3">@</span>Url.Action(<span class="s1">"ReportAdminDet"</span>, <span class="s1">"Report"</span>)<span class="s1">'</span> }, search: <span class="s5">false</span> },</p>
<p class="p1"><span class="Apple-converted-space">Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  </span>{ name: <span class="s1">'reportid'</span>, width: <span class="s1">'40'</span>, index: <span class="s1">'reportid'</span>, align: <span class="s1">'left'</span>, editable: <span class="s5">false</span>, search: <span class="s5">false, key: true</span>},</p>
<p class="p1"><span class="Apple-converted-space">Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  </span>{ name: <span class="s1">'Title'</span>, width: <span class="s1">'200'</span>, index: <span class="s1">'Title'</span>, align: <span class="s1">'left'</span>, editable: <span class="s5">true</span>, edittype: <span class="s1">'text'</span>, editoptions: { maxlength: 40, size: 60 }, editrules: { required: <span class="s5">true</span> }, formoptions: { rowpos: 1, colpos: 1 } },</p>
<p class="p1"><span class="Apple-converted-space">Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  </span>{ name: <span class="s1">'DisplayDesc'</span>, index: <span class="s1">'DisplayDesc'</span>, hidden: <span class="s5">true</span>, width: <span class="s1">'250'</span>, align: <span class="s1">'left'</span>, editable: <span class="s5">true</span>, edittype: <span class="s1">'textarea'</span>, editrules: { edithidden: <span class="s5">true</span>, required: <span class="s5">true</span> }, formoptions: { rowpos: 2, colpos: 1 } },</p>
<p class="p1"><span class="Apple-converted-space">Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  </span>{ name: <span class="s1">'HeaderDesc'</span>, index: <span class="s1">' HeaderDesc'</span>, hidden: <span class="s5">true</span>, editable: <span class="s5">true</span>, edittype: <span class="s1">'textarea'</span>, editrules: { edithidden: <span class="s5">true</span> }, formoptions: { rowpos: 2, colpos: 2 } },</p>
<p class="p1"><span class="Apple-converted-space">Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  </span>{ name: <span class="s1">'FooterDesc'</span>, index: <span class="s1">' FooterDesc'</span>, hidden: <span class="s5">true</span>, editable: <span class="s5">true</span>, edittype: <span class="s1">'textarea'</span>, editrules: { edithidden: <span class="s5">true</span> }, formoptions: { rowpos: 3, colpos: 1 } },</p>
<p class="p1"><span class="Apple-converted-space">Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  </span>{ name: <span class="s1">'reportyear'</span>, index: <span class="s1">'reportyear'</span>, width: <span class="s1">'50'</span>, align: <span class="s1">'left'</span>, editable: <span class="s5">true</span>, editoptions: { maxlength: 4 }, edittype: <span class="s1">'text'</span>, editrules: { required: <span class="s5">true</span> }, search: <span class="s5">true</span>, searchoptions: { sopt: [<span class="s1">'eq'</span>] },formoptions:{rowpos: 4, colpos: 1} },</p>
</blockquote>
<p class="p1">Notice the "key:true" property on the 'reportid' column.</p>
<p class="p1">With the latest snapshot, the ID that is used by the grid for edit/update/etc is the rowid in the grid, not the value in reportid.</p>
<p class="p1">If I remove the "key:true" property, the proper key value passed in from the data source is used (which relates to the reportid field)</p>
<p class="p1">I tracked the issue back to this commit:Â <a href="https://github.com/tonytomov/jqGrid/commit/bc8601b8dde4fa29e08b4ca08eead10a87e21316" rel="nofollow" target="_blank">https://github.com/tonytomov/jqGrid/commit/bc8601b8dde4fa29e08b4ca08eead10a87e21316</a></p>
<p class="p1">What I'm seeing is the change now requires the data to be passed in with the key specified as the column name now (before my json return string still was passing "id" as the key, but the column has this as "reportid".</p>
<p class="p1">This seems to be a limitation to the "Lib.Web.Mvc" plugin I was using to generate the Json response. Â This always sends the key as "id" in the response array. Â Before this was fine as the key seemed to be read in than the model would send back "reportid" as part of the model.</p>
<p class="p1">Now it seems the Jsonresult that generates the data has to have the same name as the column specified as the "key:true" field.</p>
<p class="p1">Would that be a correct assessment?</p>
]]></description>
        	        	<pubDate>Thu, 09 Oct 2014 19:19:52 +0300</pubDate>
        </item>
</channel>
</rss>