<?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: AdditionalDataWhenEditing</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/additionaldatawhenediting</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/additionaldatawhenediting/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>dzangger67 on AdditionalDataWhenEditing</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/additionaldatawhenediting#p24183</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/additionaldatawhenediting#p24183</guid>
        	        	<description><![CDATA[<blockquote>
<p>OlegK said:</p>
<p>Hi dzangger67,</p>
<p>what I need is the JSON data which produce the&#160;<span style="white-space: pre;">"WhamService.svc/GetNavigationDetails". Could you include the data?</span></p>
<p><span style="white-space: pre;">Independend from this you can fix you problem if you include <strong>key:true</strong> as the additional property of the &#39;id&#39; column.</span></p>
<p><span style="white-space: pre;">By the way you don&#39;t need to use separate ajax call. jqGrid can hold the data for you see <a href="http://stackoverflow.com/questions/3912008/jqgrid-does-not-populate-with-data/3914796#3914796" target="_blank">here</a> an example.</span></p>
<p><span style="white-space: pre;">Best regards<br />Oleg&#160;</span></p>
</blockquote>
<hr />
<p>Thank you Oleg.&#160; The key: true seemed to do the trick.&#160; I took a look at the link you referenced and I&#39;m in the process of adding that to my code.&#160; Thank you again 🙂</p>
<p>dave</p>
]]></description>
        	        	<pubDate>Sun, 07 Aug 2011 04:03:05 +0300</pubDate>
        </item>
        <item>
        	<title>OlegK on AdditionalDataWhenEditing</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/additionaldatawhenediting#p24182</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/additionaldatawhenediting#p24182</guid>
        	        	<description><![CDATA[<p>Hi dzangger67,</p>
<p>what I need is the JSON data which produce the&#160;<span style="white-space: pre;">"WhamService.svc/GetNavigationDetails". Could you include the data?</span></p>
<p><span style="white-space: pre;">Independend from this you can fix you problem if you include <strong>key:true</strong> as the additional property of the &#39;id&#39; column.</span></p>
<p><span style="white-space: pre;">By the way you don&#39;t need to use separate ajax call. jqGrid can hold the data for you see <a href="http://stackoverflow.com/questions/3912008/jqgrid-does-not-populate-with-data/3914796#3914796" target="_blank">here</a> an example.</span></p>
<p><span style="white-space: pre;">Best regards<br />Oleg&#160;</span></p>
]]></description>
        	        	<pubDate>Sun, 07 Aug 2011 02:55:14 +0300</pubDate>
        </item>
        <item>
        	<title>dzangger67 on AdditionalDataWhenEditing</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/additionaldatawhenediting#p24181</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/additionaldatawhenediting#p24181</guid>
        	        	<description><![CDATA[<p>Hi Oleg.&#160; This is what I have.&#160; Everything seems to work fine.&#160; The data comes back and populates the grid just fine.&#160; A column in my database table is actually called id.&#160; I would like that id to come through, not the row id.&#160; I added editable: true (and readonly: true) so that the field would come over.&#160; But it doesn&#39;t work on an add because of the readonly value.&#160; I changed the id to rec_id to see if anything changed.&#160; It did but delete wouldn&#39;t work.&#160; So I hope you can see the delimma I&#39;m in.&#160; I added the additionalDataWhenEditing property hoping that might work.&#160; That is, where I can put the id from my table in it.</p>
<p>I&#39;m new to the grid so I&#39;m still learning how this all works.&#160; And as you might be able to tell, I&#39;m using AJAX webservices in .NET.&#160;</p>
<p>Thank you!</p>
</p>
<pre>function&#160;GetNavigationDetails()&#160;{
	&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;$("#grid").jqGrid({
	&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;datatype:&#160;&#39;jsonstring&#39;,
	&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;jsonReader:&#160;{&#160;root:&#160;"rows",&#160;page:&#160;"page",&#160;total:&#160;"total",&#160;records:&#160;"records",&#160;repeatitems:&#160;true,&#160;cell:&#160;"cell"&#160;},
	&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;gridview:&#160;true,
	&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;colNames:&#160;[&#39;ID&#39;,&#160;&#39;Header&#160;ID&#39;,&#160;&#39;Title&#39;,&#160;&#39;Icon&#39;,&#160;&#39;Link&#39;,&#160;&#39;Sequence&#39;],
	&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;colModel:&#160;[{&#160;name:&#160;&#39;id&#39;,&#160;index:&#160;&#39;id&#39;,&#160;editable:&#160;true,&#160;editoptions:&#160;{&#160;readonly:&#160;true&#160;},&#160;width:&#160;20,&#160;jsonmap:&#160;&#39;id&#39;},
		{&#160;name:&#160;&#39;header_id&#39;,&#160;index:&#160;&#39;header_id&#39;,&#160;width:&#160;90,&#160;jsonmap:&#160;&#39;header_id&#39;},
		{&#160;name:&#160;&#39;title&#39;,&#160;index:&#160;&#39;title&#39;,&#160;editable:&#160;true,&#160;edittype:&#160;&#39;text&#39;,&#160;editoptions:&#160;{&#160;size:&#160;20,&#160;maxlength:&#160;30},&#160;width:&#160;100&#160;},
		{&#160;name:&#160;&#39;icon&#39;,&#160;index:&#160;&#39;icon&#39;,&#160;width:&#160;80,&#160;align:&#160;&#39;right&#39;&#160;},
		{&#160;name:&#160;&#39;link&#39;,&#160;index:&#160;&#39;link&#39;,&#160;editable:&#160;true,&#160;edittype:&#160;&#39;text&#39;,&#160;width:&#160;80,&#160;align:&#160;&#39;right&#39;&#160;},
		{&#160;name:&#160;&#39;sequence&#39;,&#160;index:&#160;&#39;sequence&#39;,&#160;width:&#160;80,&#160;align:&#160;&#39;right&#39;&#160;}],
	&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;rowNum:&#160;10,
	&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;rowList:&#160;[10,&#160;15,&#160;20],
	&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;height:&#160;&#39;auto&#39;,
	&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;loadonce:&#160;false,
	&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;sortname:&#160;"id",
	&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;viewrecords:&#160;true,
	&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;sortorder:&#160;"desc",
	&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;caption:&#160;"Navigation&#160;Details",
	&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;editurl:&#160;"WhamService.svc/SaveNavigationDetails",
	&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;pager:&#160;&#39;#pager&#39;,
	&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;scrollOffset:&#160;0
	&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}).navGrid("#pager",
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{&#160;edit:&#160;true,&#160;add:&#160;true,&#160;del:&#160;true&#160;},
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{&#160;afterShowForm:&#160;afterShowEdit,&#160;afterSubmit:&#160;processAddEdit,&#160;beforeSubmit:&#160;validateData,&#160;</pre>
<pre>		closeAfterAdd:&#160;true,&#160;closeAfterEdit:&#160;true,&#160;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;onclickSubmit:&#160;function&#160;(eparams)&#160;{
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;return&#160;{&#160;additionalDataWhenEditing:&#160;"I&#160;am&#160;additional&#160;data&#160;when&#160;editing"&#160;};
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;},
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{&#160;afterShowForm:afterShowAdd,&#160;afterSubmit:processAddEdit,&#160;beforeSubmit:validateData,&#160;</pre>
<pre>		closeAfterAdd:true,&#160;closeAfterEdit:true&#160;}
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;);
 
	&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;$("#grid").clearGridData();
 
	&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;$.ajax({
	&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;type:&#160;"POST",
	&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;contentType:&#160;"application/json;&#160;charset=utf-8",
	&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;url:&#160;"WhamService.svc/GetNavigationDetails",
	&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;dataType:&#160;"json",
	&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;success:&#160;function&#160;(msg)&#160;{
	&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;var&#160;data&#160;=&#160;msg.d;
	&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;$("#grid").jqGrid(&#39;setGridParam&#39;,&#160;{&#160;datatype:&#160;&#39;jsonstring&#39;,&#160;datastr:&#160;data&#160;});
	&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;$("#grid").trigger(&#39;reloadGrid&#39;);
	&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}
	&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;});
	&#160;&#160;&#160;&#160;};</pre>
]]></description>
        	        	<pubDate>Sun, 07 Aug 2011 01:41:18 +0300</pubDate>
        </item>
        <item>
        	<title>OlegK on AdditionalDataWhenEditing</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/additionaldatawhenediting#p24180</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/additionaldatawhenediting#p24180</guid>
        	        	<description><![CDATA[<p>From your question is uncler how you fill the grid. If you do this in the correct way you use <em>&#39;rec_id&#39;</em>&#160;as the id value in your JSON response from the server. In the case the rowid will be the same as your database id. If you want display the record id to the user abd have <em>&#39;rec_id&#39;</em> as the column you can include <strong>key:true</strong> property in <em>&#39;rec_id&#39;</em> column of you <em>colModel</em>. In the case the <em>id</em> field in the JSON input will be ignored and the value for the <em>rec_id&#39;</em>&#160;column will be used as the rowid.</p>
<p>Best regards<br />Oleg&#160;</p>
]]></description>
        	        	<pubDate>Sun, 07 Aug 2011 00:58:47 +0300</pubDate>
        </item>
        <item>
        	<title>dzangger67 on AdditionalDataWhenEditing</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/additionaldatawhenediting#p24179</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/additionaldatawhenediting#p24179</guid>
        	        	<description><![CDATA[<p>Hi.&#160; I&#39;m using jqGrid and would like to see the id to my records instead of the rowid while trying to edit/delete a record.&#160; Is there a way I can pass in the value of my id (it&#39;s in the grid) to the server function?&#160;</p>
<p>For example, we know we get id (the row) and the oper (del).&#160; But if the id to my record is being deleted, say 312, can I get 312 returned as well? Below is where I was trying to return &#39;rec_id&#39;</p>
<pre>.navGrid("#pager",&#160;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{&#160;edit:&#160;true,&#160;add:&#160;true,&#160;del:&#160;true&#160;},
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{&#160;afterShowForm:&#160;afterShowEdit,&#160;afterSubmit:&#160;processAddEdit,&#160;beforeSubmit:&#160;validateData,&#160;closeAfterAdd:&#160;true,&#160;closeAfterEdit:&#160;true,&#160;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;onclickSubmit:&#160;function&#160;(eparams)&#160;{
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;return&#160;{&#160;additionalDataWhenEditing:&#160;&#39;rec_id&#39;&#160;};
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {&#160;afterShowForm:afterShowAdd,&#160;afterSubmit:processAddEdit,&#160;beforeSubmit:validateData,&#160;closeAfterAdd:true,&#160;closeAfterEdit:true&#160;}<br /><br />thank you</pre>
]]></description>
        	        	<pubDate>Sun, 07 Aug 2011 00:29:24 +0300</pubDate>
        </item>
</channel>
</rss>