<?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: closeAfterAdd issue &#38; Deleting a row without reloadAfterSubmit issue...</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/closeafteradd-issue-deleting-a-row-without-reloadaftersubmit-issue</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/closeafteradd-issue-deleting-a-row-without-reloadaftersubmit-issue/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tony on closeAfterAdd issue &#38; Deleting a row without reloadAfterSubmit issue...</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/closeafteradd-issue-deleting-a-row-without-reloadaftersubmit-issue#p15255</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/closeafteradd-issue-deleting-a-row-without-reloadaftersubmit-issue#p15255</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>As per documentation these events should return something. (Please look carfully here)</p>
<p><a href="http://www.trirand.com/jqgridwiki/doku.php?id=wiki:form_editing#editgridrow" rel="nofollow" target="_blank"><a href="http://www.trirand.com/jqgridw" rel="nofollow">http://www.trirand.com/jqgridw</a>.....ditgridrow</a></p>
</p>
<p>So in you case you should:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit9819' value='Select Code' data-codeid='sfcode9819' /></p>
<div class='sfcode' id='sfcode9819'>
<p>function function successFuncAdd((data,id)</p>
<p>{</p>
<p>...</p>
<p>return [true,"",""]</p>
<p>}</p>
</div>
<p>The same for the second event successFuncDelete</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Mon, 01 Mar 2010 20:06:30 +0200</pubDate>
        </item>
        <item>
        	<title>mikesmith on closeAfterAdd issue &#38; Deleting a row without reloadAfterSubmit issue...</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/closeafteradd-issue-deleting-a-row-without-reloadaftersubmit-issue#p15249</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/closeafteradd-issue-deleting-a-row-without-reloadaftersubmit-issue#p15249</guid>
        	        	<description><![CDATA[<p>Hi Tony</p>
<p>Here are my 2 peices of code below, I am probably missing something or not returning correctly at all.&#160; Just noticed in successFuncAdd, I am not returning anything. Not sure if thats it. But I do return true/false in my delete function.</p>
<p>Heres the add function..</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit8990' value='Select Code' data-codeid='sfcode8990' /></p>
<div class='sfcode' id='sfcode8990'>&#160;&#160;&#160;&#160; &#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; function successFuncAdd(data, id){<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;var jsonResponseObj = JSON.parse(data.responseText);<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;var result = displayMessage(jsonResponseObj);//returns true/false if error from server =&#62;false.we show messages when its success as well(true)<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;var newUrl = &#34;documentControl/retrieveAll.action?oper=searchAdd&#34;;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;jQuery(&#34;#gridedittable&#34;).jqGrid(&#39;setGridParam&#39;,{url:newUrl,page:1});<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160; //reload grid&#160;&#160; &#160;&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; jQuery(&#34;#gridedittable&#34;).jqGrid(&#39;setCaption&#39;,gridCaption).trigger(&#39;reloadGrid&#39;);&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;}</div>
<p>&#38; here is the delete one</p>
<p><input type='button' class='sfcodeselect' name='sfselectit1854' value='Select Code' data-codeid='sfcode1854' /></p>
<div class='sfcode' id='sfcode1854'>&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; function successFuncDelete(data,id){<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;var jsonResponseObj = JSON.parse(data.responseText);<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;var result = displayMessage(jsonResponseObj);<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;if(result == false){//restore row<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;alert(&#34;restore rowid: &#34;+id.id);<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;jQuery(&#34;#gridedittable&#34;).jqGrid(&#39;restoreRow&#39;,id.id);&#160;&#160; &#160;</p>
<p>&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;}else{<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;alert(&#34;yoooo id &#34;+id.id);&#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;}<br />&#160;&#160; &#160;&#160;&#160; &#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;return result;//will simply be true/false (false=&#62;error&#38; true=&#62;success) &#160;&#160; &#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;}</p>
</div>
]]></description>
        	        	<pubDate>Mon, 01 Mar 2010 17:40:09 +0200</pubDate>
        </item>
        <item>
        	<title>tony on closeAfterAdd issue &#38; Deleting a row without reloadAfterSubmit issue...</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/closeafteradd-issue-deleting-a-row-without-reloadaftersubmit-issue#p15233</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/closeafteradd-issue-deleting-a-row-without-reloadaftersubmit-issue#p15233</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Could you please post your two afterSubmit functions - i.e one for the adding and the other for the deleting.</p>
<p>Please consult here what should return therse funcions here (not simple false/true, but array)</p>
<p><a href="http://www.trirand.com/jqgridwiki/doku.php?id=wiki:form_editing" rel="nofollow" target="_blank"><a href="http://www.trirand.com/jqgridw" rel="nofollow">http://www.trirand.com/jqgridw</a>.....rm_editing</a></p>
<p>Best Regards</p>
<p>Tony</p></p>
]]></description>
        	        	<pubDate>Sat, 27 Feb 2010 22:10:15 +0200</pubDate>
        </item>
        <item>
        	<title>mikesmith on closeAfterAdd issue &#38; Deleting a row without reloadAfterSubmit issue...</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/closeafteradd-issue-deleting-a-row-without-reloadaftersubmit-issue#p15169</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/closeafteradd-issue-deleting-a-row-without-reloadaftersubmit-issue#p15169</guid>
        	        	<description><![CDATA[<p>Hi there, I have 2 issues that I am not sure if it is a bug in jqgrid or I am missing something.</p>
</p>
<p>Issue 1: when I add a row in my grid with these options, the add modal popup does NOT close:</p>
<p>navigatorAddOptions="{height:500,reloadAfterSubmit:false,<strong>afterSubmit:successFuncAdd</strong>,closeAfterAdd:true}"</p>
</p>
<p>If i dont include option afterSubmit like so:&#160; navigatorAddOptions="{height:500,reloadAfterSubmit:false,closeAfterAdd:true}"</p>
<p>It works fine &#38; closes.</p>
<p>
In my function succesFuncAdd, I set a brand new url &#38; trigger a reload which works fine:</p>
<p>jQuery("#gridedittable").jqGrid(&#39;setCaption&#39;,gridCaption).trigger(&#39;reloadGrid&#39;);</p>
<p>Why then does the add popup modal not close after this? I tried to check in firebug but I got no error. I have tried to put the options in different order but it makes no difference. anyone with help on this? could this be an issue the struts2 plugin I am using?</p>
</p>
<p>Issue 2: Deleting a row. Basically when I delete a row I check my response from the server also by having an afterSubmit option.</p>
<p>If the server returns an error i return false. I am expecting jqgrid not to delete the row(since error from server as i returned false for afterSubmit function), However, jqgrid does delete the row. is this functionality correct by jqgrid?&#160;</p>
<p>To counteract this, I tried to simply restore the row by calling this in my afterSubmit option function:</p>
<p>jQuery("#gridedittable").jqGrid(&#39;restoreRow&#39;,id.id);&#160;&#160; &#38; this did work.</p>
<p>However, after calling this restoreRow once, I cannot delete any other subsequent rows afterthat!!&#160; I get no error, delete simply doesnt work again. Very very strange.</p>
</p>
<p>Anyone with any ideas on these 2? Thanks for any help.</p>
]]></description>
        	        	<pubDate>Thu, 25 Feb 2010 23:20:50 +0200</pubDate>
        </item>
</channel>
</rss>