<?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: Reloading grid after insert/edit data using custom button</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/reloading-grid-after-insertedit-data-using-custom-button</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/reloading-grid-after-insertedit-data-using-custom-button/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>silver11 on Reloading grid after insert/edit data using custom button</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/reloading-grid-after-insertedit-data-using-custom-button#p28984</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/reloading-grid-after-insertedit-data-using-custom-button#p28984</guid>
        	        	<description><![CDATA[<p>i&#39;m using this "new" form editing, as what tony suggest me <a href="/blog/?page_id=393/help/how-to-change-form-editing-looks/" target="_blank">here</a>, which is actually my own made form and it was called by a custom button. everything seems work well for me except for one thing, i had to refresh/reload the grid manually to see the change i made in the data.</p>
<p>first of all, this is part of my code</p>
<blockquote>
<p>&#160;jqGrid(&#39;navButtonAdd&#39;,&#39;#pagerMod&#39;,<br />{caption:"Add",<br />&#160; &#160; &#160;onClickButton:function()<br />&#160; &#160; &#160;{</p>
<p>&#160; &#160; &#160;var url = "modform.php";</p>
<p>&#160; &#160;&#160; window.open(url, "Mod Form", "left=400, top=100, height=500, width=600;");<br />&#160; &#160; &#160;}<br />})<br />.jqGrid(&#39;navButtonAdd&#39;,&#39;#pagerMod&#39;,<br />{caption:"Edit", onClickButton:function()<br /> {<br />&#160; &#160;&#160; var mid = jQuery("#Mod").jqGrid(&#39;getGridParam&#39;, &#39;selrow&#39;);<br />&#160; &#160;&#160; var url = "modform.php";<br />&#160; &#160; &#160;var url = url+"?but=edit&#38;mid="+mid;</p>
<p>&#160; &#160; &#160;if (mid)<br />&#160; &#160; &#160; &#160; &#160; window.open(url, "Mod Form", "left=400, top=100, height=500, width=600;");<br />&#160; &#160; &#160;else<br />&#160; &#160; &#160;{<br />&#160; &#160; &#160; &#160; &#160; var alertIDs = {themodal:&#39;alertmod&#39;,modalhead:&#39;alerthd&#39;,modalcontent:&#39;alertcnt&#39;};<br />&#160; &#160; &#160; &#160; &#160; if ($("#"+alertIDs.themodal).html() === null)<br />&#160; &#160; &#160; &#160; &#160; {<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;$.jgrid.createModal(alertIDs,"&#60;div&#62;"+$.jgrid.nav.alerttext+"&#60;/div&#62;&#60;span tabindex=&#39;0&#39;&#62;&#60;span tabindex=&#39;-1&#39; id=&#39;jqg_alrt&#39;&#62;&#60;/span&#62;&#60;/span&#62;",<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;{<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&#160; &#160; &#160;gbox:"#gbox_"+$.jgrid.jqID(this.p.id), jqModal:true, drag:true, resize:true,<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&#160; &#160; &#160;caption:$.jgrid.nav.alertcap, top:100, left:100, width:200, height:&#39;auto&#39;, closeOnEscape:true,<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&#160; &#160; &#160;zIndex: null<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;},"","",true);<br />&#160; &#160; &#160; &#160; &#160; }<br />&#160; &#160; &#160; &#160; &#160; $.jgrid.viewModal("#"+alertIDs.themodal,{gbox:"#gbox_"+$.jgrid.jqID(this.p.id),jqm:true});<br />&#160; &#160; &#160; &#160; &#160; $("#jqg_alrt").focus();<br />&#160; &#160; &#160;}<br />}<br />})</p>
</blockquote>
<p>the modform.php is a file where i wanna insert the data into database (sql server). after the data successfully inserted/edited, i want the grid to refresh himself just like after we click submit button when we do form editing.</p>
<p>so can any of you guys tell me how can i do this? i&#39;ve also used&#160;$("#Mod").trigger("reloadGrid") before the close of onClickButton function but it affects nothing</p>
<p>regards and thanks in advance</p>
]]></description>
        	        	<pubDate>Tue, 11 Jun 2013 12:36:32 +0300</pubDate>
        </item>
</channel>
</rss>