<?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: Wrong onclicksubmit being fired for jqGrid</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/wrong-onclicksubmit-being-fired-for-jqgrid</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/wrong-onclicksubmit-being-fired-for-jqgrid/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>solsagan on Wrong onclicksubmit being fired for jqGrid</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/wrong-onclicksubmit-being-fired-for-jqgrid#p24487</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/wrong-onclicksubmit-being-fired-for-jqgrid#p24487</guid>
        	        	<description><![CDATA[<p>Had the same problem, haven&#39;t looked at the jqGrid code yet, but did find a workaround.</p>
</p>
<p>In the code example that you gave, change the&#160;<span style="white-space: pre;">onclickSubmit() for both the edit and add options to point to the same function</span></p>
<p><input type='button' class='sfcodeselect' name='sfselectit401' value='Select Code' data-codeid='sfcode401' /></p>
<div class='sfcode' id='sfcode401'>
<pre>var afterSubmitFunction = function (rp_ge, postdata) {
  switch (postdata.oper) {
    case &#34;edit&#34;:
    break;
    case &#34;add&#34;:
    break;
    case &#34;del&#34;:
    break;
  }
}

var beforeSubmitFunction = function (rp_ge, postdata) {
  var myGridID = &#34;treegrid&#34;;
  switch (true) {
    case typeof postdata[myGridID+&#34;_id&#34;] == &#34;undefined&#34; : // Delete button
      // Do delete stuffs
    break;
    case postdata[myGridID+&#34;_id&#34;] == &#34;_empty&#34; : //Add button
      // Do Add stuffs
    break;
    default : // Edit Button
      // Do edit Stuffs
    break;
  }
}
</pre>
</div>
]]></description>
        	        	<pubDate>Wed, 31 Aug 2011 17:23:17 +0300</pubDate>
        </item>
        <item>
        	<title>shah on Wrong onclicksubmit being fired for jqGrid</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/wrong-onclicksubmit-being-fired-for-jqgrid#p23970</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/wrong-onclicksubmit-being-fired-for-jqgrid#p23970</guid>
        	        	<description><![CDATA[<p>I am using a treegrid.</p>
<p>It seems like wrong onClickSubmit is being fired.</p>
</p>
<p>On loading the grid if i click on edit button and submit the onclicksubmit of the edit fires which is correct. but when i click on Add the correct Add screen appears but onclicksubmit of the edit fires!</p>
<p>If i reload the page and click on Add the onClickSubmit of the Add fires which is correct, next i try to edit Edity form appears and the onclickSubmit of the Add fires.. Please help!!</p>
<p>here is the code</p>
<p><a href="http://pastie.org/private/ycfwwl2ygnzbxdqgjyohq" rel="nofollow" target="_blank"><a href="http://pastie.org/private/ycfw" rel="nofollow">http://pastie.org/private/ycfw</a>.....bxdqgjyohq</a></p>
</p>
<p>Please help!<img class="spSmiley" style="margin:0" title="Cry" src="/blog/wp-content/forum-smileys/sf-cry.gif" alt="Cry" /></p>
]]></description>
        	        	<pubDate>Fri, 15 Jul 2011 21:59:12 +0300</pubDate>
        </item>
</channel>
</rss>