<?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: Unable to add row to jqgrid using jsonstring</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/unable-to-add-row-to-jqgrid-using-jsonstring</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/unable-to-add-row-to-jqgrid-using-jsonstring/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>webuiProgrammer2013 on Unable to add row to jqgrid using jsonstring</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/unable-to-add-row-to-jqgrid-using-jsonstring#p29424</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/unable-to-add-row-to-jqgrid-using-jsonstring#p29424</guid>
        	        	<description><![CDATA[<p>I have set up a jqgrid which is populated using a jsonstring from my servlet. I am trying to use the jqgrid form editing to add a new row. My grid only contains two columns: product and edit (only product is editable). I want to add rows to the grid without sending the data to my servlet but I am unsure how. So far I have stopped the error "no url set" by using &#160;cellsubmit: &#39;clientArray&#39;, &#160;cellEdit: true, &#160;editurl:${dummyUrl} but nothing is added to the grid.</p>
</p>
<p>I have seen a forum post suggesting to use "beforeSubmit : function(postdata, formid)" but I am unsure how to add the postData to the jsonstring in the function.</p>
</p>
<p>My code:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit8044' value='Select Code' data-codeid='sfcode8044' /></p>
<div class='sfcode' id='sfcode8044'>
<p>jQuery(&#34;#productTable&#34;).jqGrid({</p>
<p><span style=&#34;white-space: pre;&#34;> </span>jsonReader: {</p>
<p><span style=&#34;white-space: pre;&#34;> </span>root: &#34;products&#34;,</p>
<p><span style=&#34;white-space: pre;&#34;> </span>repeatitems: false,</p>
<p><span style=&#34;white-space: pre;&#34;> </span>cell: &#34;&#34;, &#160;</p>
<p><span style=&#34;white-space: pre;&#34;> </span>id: &#34;id&#34;,&#160;</p>
<p><span style=&#34;white-space: pre;&#34;> </span>&#160;},</p>
<p><span style=&#34;white-space: pre;&#34;> </span>datatype: &#34;jsonstring&#34;,</p>
<p><span style=&#34;white-space: pre;&#34;> </span>datastr: ${productData},</p>
<p><span style=&#34;white-space: pre;&#34;> </span>height: 100,</p>
<p><span style=&#34;white-space: pre;&#34;> </span>loadonce: true,</p>
<p><span style=&#34;white-space: pre;&#34;> </span>colNames:[&#39;Product&#39;, &#39;Edit&#39;],</p>
<p><span style=&#34;white-space: pre;&#34;> </span>colModel:</p>
<p><span style=&#34;white-space: pre;&#34;> </span>[</p>
<p><span style=&#34;white-space: pre;&#34;> </span>{name:&#39;product&#39;, index:&#39;product&#39;, width:150, editable:true},</p>
<p><span style=&#34;white-space: pre;&#34;> </span>{ name:&#39;edit&#39;,index:&#39;edit&#39;, width: 50, align:&#39;center&#39;, sortable: false, search: false,</p>
<p><span style=&#34;white-space: pre;&#34;> </span>formatter:function(){</p>
<p><span style=&#34;white-space: pre;&#34;> </span>return &#34;&#60;span class=&#39;ui-icon ui-icon-pencil&#39;&#62;&#60;/span&#62;&#34;</p>
<p><span style=&#34;white-space: pre;&#34;> </span>}},</p>
<p><span style=&#34;white-space: pre;&#34;> </span>],</p>
<p><span style=&#34;white-space: pre;&#34;> </span>caption: &#34;Products&#34;,</p>
<p><span style=&#34;white-space: pre;&#34;> </span>pager: &#34;#productPager&#34;,</p>
<p><span style=&#34;white-space: pre;&#34;> </span>pgbuttons: false,</p>
<p><span style=&#34;white-space: pre;&#34;> </span>pgtext: null,</p>
<p><span style=&#34;white-space: pre;&#34;> </span>viewrecords: true,</p>
<p><span style=&#34;white-space: pre;&#34;> </span>editurl: ${dummyUrl},</p>
<p><span style=&#34;white-space: pre;&#34;> </span>cellEdit: true,</p>
<p><span style=&#34;white-space: pre;&#34;> </span>cellsubmit: &#39;clientArray&#39;,</p>
<p><span style=&#34;white-space: pre;&#34;> </span>gridComplete:function(){</p>
<p><span style=&#34;white-space: pre;&#34;> </span>jQuery(&#34;#productTable&#34;).jqGrid(&#39;navGrid&#39;,&#34;#productPager&#34;,{edit:false, add:true, del:false, search:false, refresh:false});</p>
<p><span style=&#34;white-space: pre;&#34;> </span>}</p>
<p>});</p>
</div>
<p>&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&#160;</p>
]]></description>
        	        	<pubDate>Fri, 30 Aug 2013 02:45:17 +0300</pubDate>
        </item>
</channel>
</rss>