<?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: How to send additional POST data when deleting a row?</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/how-to-send-additional-post-data-when-deleting-a-row</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/how-to-send-additional-post-data-when-deleting-a-row/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>richsoe on How to send additional POST data when deleting a row?</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-to-send-additional-post-data-when-deleting-a-row#p17185</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-to-send-additional-post-data-when-deleting-a-row#p17185</guid>
        	        	<description><![CDATA[<p>Finally solve it. There was a mistake in the previous code, it should be like the following.</p>
<p>
$("#del").click(function(){ <br />&#160;&#160; &#160; var gr =  jQuery("#tags").jqGrid(&#39;getGridParam&#39;,&#39;selrow&#39;);<br />&#160;&#160; &#160; if( gr != null )  {<br />&#160;&#160;  &#160;&#160;&#160;&#160; jQuery("#tags").jqGrid(&#39;delGridRow&#39;,gr, {reloadAfterSubmit:true,</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; onclickSubmit: function(params){</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var gr =  jQuery("#tags").jqGrid(&#39;getGridParam&#39;,&#39;selrow&#39;);</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var val = jQuery(&#39;#tags&#39;).jqGrid(&#39;getCell&#39;,gr,&#39;list_id&#39;);</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return  {list_id:val};}}); <br />&#160;&#160; &#160; }<br />&#160;&#160; &#160; else { alert("Please select row to  delete!");&#160; }<br />});</p>
</p>
<p><img class="spSmiley" style="margin:0" title="Cool" src="/blog/wp-content/forum-smileys/sf-cool.gif" alt="Cool" /></p>
]]></description>
        	        	<pubDate>Sat, 15 May 2010 18:07:53 +0300</pubDate>
        </item>
        <item>
        	<title>richsoe on How to send additional POST data when deleting a row?</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-to-send-additional-post-data-when-deleting-a-row#p17184</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-to-send-additional-post-data-when-deleting-a-row#p17184</guid>
        	        	<description><![CDATA[<p>Tim,</p>
<p>I tried custom buttons, but it&#39;s a little different from what you&#39;ve suggested. I can now delete and add but still having problem with it. Let me explain the situation in detail...</p>
<p>I&#39;m having a master grid that lists out all book lists. When I click on a book list, it will list out the users who subscribed that book list in another gridvew (detail gridview). I followed the example from the demo page, "Master Detail", <a href="http://www.trirand.com/blog/jqgrid/jqgrid.html" rel="nofollow" target="_blank"><a href="http://www.trirand.com/blog/jq" rel="nofollow">http://www.trirand.com/blog/jq</a>.....qgrid.html</a>.</p>
<p>What I want to do is to be able to add / delete users from the detail gridview. Literally, I can add / delete users of a book list. The problem now is that when I delete a user of a book list and then I click on another book list and try to delete the user, it doesn&#39;t delete that user. I don&#39;t see any problem with add.</p>
<p>&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;<br />$("#del").click(function(){ <br />&#160;&#160; &#160; var gr = jQuery("#tags").jqGrid(&#39;getGridParam&#39;,&#39;selrow&#39;);<br />&#160;&#160; &#160; if( gr != null ) {<br />&#160;&#160; &#160;&#160;&#160;&#160; var val = jQuery(&#39;#tags&#39;).jqGrid(&#39;getCell&#39;,gr,&#39;list_id&#39;);<br />&#160;&#160; &#160;&#160;&#160;&#160; jQuery("#tags").jqGrid(&#39;delGridRow&#39;,gr, {reloadAfterSubmit:true,</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; onclickSubmit: function(params){alert(val); return {list_id:val};}}); <br />&#160;&#160; &#160; }<br />&#160;&#160; &#160; else { alert("Please select row to delete!");&#160; }<br />});</p>
</p>
<p>I notice that the culprit was the&#160; on the onclickSubmit event. If you see the code, I&#39;m trying to get the list_id from the gridview ("val" variable), and it is fine. Inside the onclickSubmit event, I try to display the "val", but it always displays the previous list_id.</p>
<p>Is this a bug? Or, is this probably cache? If yes, how to clear it?</p>
</p>
<p>I did exactly the same thing for add, I could get the correct list_id everytime.</p>
<p>$("#add").click(function(){<br />&#160;&#160; var gr = jQuery("#tags").jqGrid(&#39;getGridParam&#39;,&#39;selrow&#39;);<br />&#160;&#160; if( gr != null ) {<br />&#160;&#160;&#160;&#160;&#160; var val = jQuery(&#39;#tags&#39;).jqGrid(&#39;getCell&#39;,gr,&#39;list_id&#39;);<br />&#160;&#160;&#160;&#160;&#160; jQuery("#tags").jqGrid(&#39;editGridRow&#39;,&#39;new&#39;, {closeAfterAdd:true, reloadAfterSubmit:true,</p>
<p>&#160;&#160;&#160;&#160;&#160; onclickSubmit: function(params){return {list_id:val};}});<br />&#160;&#160; }<br />&#160;&#160; else {<br />&#160;&#160;&#160;&#160;&#160; alert("Please put cursor on the grid!");<br />&#160;&#160; }</p>
<p>});</p>
</p>
<p><img class="spSmiley" style="margin:0" title="Cry" src="/blog/wp-content/forum-smileys/sf-cry.gif" alt="Cry" /></p>
]]></description>
        	        	<pubDate>Sat, 15 May 2010 17:29:55 +0300</pubDate>
        </item>
        <item>
        	<title>tim on How to send additional POST data when deleting a row?</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-to-send-additional-post-data-when-deleting-a-row#p17175</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-to-send-additional-post-data-when-deleting-a-row#p17175</guid>
        	        	<description><![CDATA[<p>I would suggest you create a custom button:</p>
<p><a rel="nofollow" href="/jqgridwiki/doku.php?id=wiki:custom_buttons" target="_blank"></a><a href="http://www.trirand.com/jqgridw" rel="nofollow" target="_blank">http://www.trirand.com/jqgridw</a>.....om_buttons</p>
<p>1. you can use the pre-submit events to store global variables holding the rowid and the cellvalue (your userid).</p>
<p>2. then have a custom button function that triggers an ajax post:</p>
<p>example&#8230;.</p>
<p><input type='button' class='sfcodeselect' name='sfselectit5442' value='Select Code' data-codeid='sfcode5442' /></p>
<div class='sfcode' id='sfcode5442'>
<pre id=&#34;&#34;line1&#34;&#34;>.jqGrid(&#39;navButtonAdd&#39;,&#39;#jQGridpager&#39;,{buttonicon:&#39;ui-icon-wrench&#39;,<br />    onClickButton:function(){$.post(&#39;my-delete-url?rowid=therow&#38;user=userid&#39;);},caption:&#39;Delete!&#39;});<br /></pre>
</div>
<p>[edit: if your post already works then just read #1 and store the cellvalue in a variable]</p>
<p>tim</p>
]]></description>
        	        	<pubDate>Fri, 14 May 2010 20:10:06 +0300</pubDate>
        </item>
        <item>
        	<title>richsoe on How to send additional POST data when deleting a row?</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-to-send-additional-post-data-when-deleting-a-row#p17170</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-to-send-additional-post-data-when-deleting-a-row#p17170</guid>
        	        	<description><![CDATA[<p>I can get the post data working but couldn&#39;t get the user_id from the grid</p>
</p>
<p>jQuery("#tags").jqGrid({<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;url:&#39;admin.lists.tags.subgrid.process.php?k=kiskool&#38;list_id=0&#39;,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;editurl: "admin.lists.tags.subgrid.process.php?k=kiskool&#38;list_id=0",<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;datatype: "json",<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;mtype: "POST",<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;colNames:[&#39;id&#39;,&#39;tag&#39;,&#39;record_status_type_id&#39;,&#39;list_id&#39;],<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;colModel:[<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;id&#39;, index:&#39;id&#39;, width:100},<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;tag&#39;, index:&#39;tag&#39;, width:200, editable:true},<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;record_status_type_id&#39;, index:&#39;record_status_type_id&#39;, width:200},<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;list_id&#39;, index:&#39;list_id&#39;, width:100}<br />&#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;pager: &#39;#pagernav2&#39;,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;rowNum:10,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;rowList:[10,20,30,40,50,100],<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;sortname: &#39;id&#39;,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;sortorder: "asc",<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;caption: "Manage Lists-Tags Association",<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;height: 200<br />&#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;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;jQuery("#tags").jqGrid(&#39;navGrid&#39;,&#39;#pagernav2&#39;,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{add:true,edit:false,del:true,search:false}, //options<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{}, // edit options<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{mtype:"POST",closeAfterAdd:true,reloadAfterSubmit:true,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;onclickSubmit: function(rowid){<br />&#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;var val = $(&#39;#tags&#39;).getCell(rowid, &#39;list_id&#39;);<br />&#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;return {list_id:val};<br />&#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;} <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;}, // add options<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{mtype:"POST",reloadAfterSubmit:true,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;onclickSubmit: function(rowid){<br />&#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;var val = $(&#39;#tags&#39;).getCell(rowid, &#39;list_id&#39;); <br />&#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;return {list_id:val};<br />&#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;}<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;}, // del options<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{} // search options<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;);</p>
</p>
<p>This part always returns false: var val = $(&#39;#tags&#39;).getCell(rowid, &#39;list_id&#39;);</p>
<p>Any clue??</p>
]]></description>
        	        	<pubDate>Fri, 14 May 2010 14:33:49 +0300</pubDate>
        </item>
        <item>
        	<title>richsoe on How to send additional POST data when deleting a row?</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-to-send-additional-post-data-when-deleting-a-row#p17169</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-to-send-additional-post-data-when-deleting-a-row#p17169</guid>
        	        	<description><![CDATA[<p>When deleting / adding a row, I need to send additional parameter in form of POST data. By default, only "oper" and "id" paramters being sent over. Let&#39;s say I need to delete / add based on "user_id" (a foreign key of the dataset), how can I put it into the POST data?</p>
<p>This is what I tried but didnt work.</p>
<p>onclickSubmit: function(rowid) {<br /> var val =  $(&#39;#tags&#39;).getCell(rowid, &#39;user_id&#39;);<br /> return {user_id:val}; <br /> }</p>
</p>
<p>Please help....I can&#39;t delete or add anything.</p>
]]></description>
        	        	<pubDate>Fri, 14 May 2010 14:12:23 +0300</pubDate>
        </item>
</channel>
</rss>