<?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: Performing an action after an inline edit.</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/performing-an-action-after-an-inline-edit</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/performing-an-action-after-an-inline-edit/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>sepoto on Performing an action after an inline edit.</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/performing-an-action-after-an-inline-edit#p28732</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/performing-an-action-after-an-inline-edit#p28732</guid>
        	        	<description><![CDATA[<p>In this case I have a jqGrid with a #pager that has an edit button exposed that will allow a user to perform an inline edit. I would like to do some saving of the edited values using jQuery.data() after the save button has been clicked on the #pager. How can I accomplish this task with jqGrid?</p>
</p>
<p>lastSel = "";</p>
<p>$(function(){</p>
<p>var myGrid = jQuery("#list");</p>
<p>console.log(myGrid);</p>
</p>
<p>$("#list").jqGrid({</p>
<p>url:&#39;php.scripts/customers.get.php&#39;,</p>
<p>datatype: &#39;xml&#39;,</p>
<p>mtype: &#39;POST&#39;,</p>
<p>colNames:[&#39;idcustomers&#39;,&#39;firstname&#39;, &#39;lastname&#39;,&#39;address1&#39;,&#39;address2&#39;,&#39;city&#39;,&#39;state&#39;,&#39;zip&#39;,&#39;phone&#39;,&#39;email&#39;,&#39;cell&#39;],</p>
<p>colModel :[</p>
<p>{name:&#39;idcustomers&#39;, index:&#39;idcustomers&#39;, width:55},</p>
<p>{name:&#39;firstname&#39;, index:&#39;firstname&#39;, width:90, editable: true},</p>
<p>{name:&#39;lastname&#39;, index:&#39;lastname&#39;, width:90, editable: true},</p>
<p>{name:&#39;address1&#39;, index:&#39;address1&#39;, width:90, editable: true},</p>
<p>{name:&#39;address2&#39;, index:&#39;address2&#39;, width:90, editable: true},</p>
<p>{name:&#39;city&#39;, index:&#39;city&#39;, width:90, editable: true},</p>
<p>{name:&#39;state&#39;, index:&#39;state&#39;, width:90, editable: true},</p>
<p>{name:&#39;zip&#39;, index:&#39;zip&#39;, width:90, editable: true},</p>
<p>{name:&#39;phone&#39;, index:&#39;phone&#39;, width:90, editable: true},</p>
<p>{name:&#39;email&#39;, index:&#39;email&#39;, width:90, editable: true},</p>
<p>{name:&#39;cell&#39;, index:&#39;cell&#39;, width:90, editable: true}</p>
<p>],</p>
<p>pager: &#39;#pager&#39;,</p>
<p>rowNum:20,</p>
<p>rowList:[20,100,300],</p>
<p>sortname: &#39;idcustomers&#39;,</p>
<p>sortorder: &#39;asc&#39;,</p>
<p>shrinkToFit: true,</p>
<p>viewrecords: true,</p>
<p>gridview: true,</p>
<p>caption: &#39;Customers&#39;,</p>
<p>width: 1400,</p>
<p>height: 290,</p>
<p>editurl: &#39;php.scripts/jqgrid.updaterow.php&#39;,</p>
<p>ajaxGridOptions: {type:"POST"},</p>
<p>onSelectRow: function(id){</p>
<p>if(id &#38;&#38; id!==lastSel){</p>
<p>jQuery(&#39;#list&#39;).restoreRow(lastSel);</p>
<p>lastSel=id;</p>
<p>jQuery("#list").data(&#39;selid&#39;,lastSel);</p>
</p>
<p>console.log(lastSel);</p>
<p>console.log(jQuery("#list").data(&#39;selid&#39;));</p>
<p>$.ajax({</p>
<p>type: "POST",</p>
<p>url: "php.scripts/customers.setid.php",</p>
<p>data: { idcustomers: jQuery("#list").data(&#39;selid&#39;) }</p>
<p>}).done(function( msg )</p>
<p>{</p>
<p>console.log(msg);</p>
<p>});</p>
</p>
<p>jQuery(&#39;#list&#39;).data(&#39;selid&#39;, jQuery("#list").getCell(lastSel,0));</p>
<p>jQuery(&#39;#list&#39;).data(&#39;firstname&#39;, jQuery("#list").getCell(lastSel,1));</p>
<p>jQuery(&#39;#list&#39;).data(&#39;lastname&#39;, jQuery("#list").getCell(lastSel,2));</p>
<p>jQuery(&#39;#list&#39;).data(&#39;address1&#39;, jQuery("#list").getCell(lastSel,3));</p>
<p>jQuery(&#39;#list&#39;).data(&#39;address2&#39;, jQuery("#list").getCell(lastSel,4));</p>
<p>jQuery(&#39;#list&#39;).data(&#39;city&#39;, jQuery("#list").getCell(lastSel,5));</p>
<p>jQuery(&#39;#list&#39;).data(&#39;state&#39;, jQuery("#list").getCell(lastSel,6));</p>
<p>jQuery(&#39;#list&#39;).data(&#39;zip&#39;, jQuery("#list").getCell(lastSel,7));</p>
<p>jQuery(&#39;#list&#39;).data(&#39;phone&#39;, jQuery("#list").getCell(lastSel,8));</p>
<p>jQuery(&#39;#list&#39;).data(&#39;email&#39;, jQuery("#list").getCell(lastSel,9));</p>
<p>jQuery(&#39;#list&#39;).data(&#39;cell&#39;, jQuery("#list").getCell(lastSel,10));</p>
</p>
<p>}</p>
</p>
<p>}</p>
<p>})</p>
<p>.jqGrid(&#39;navGrid&#39;,&#39;#pager&#39;,{ edit: false, add: true, search: false }, {}, {}, {}, {},  {})</p>
<p>.jqGrid(&#39;inlineNav&#39;,"#pager",{})</p>
<p>.jqGrid(&#39;navButtonAdd&#39;,"#pager",{caption:"Toggle",title:"Toggle Search Toolbar", buttonicon :&#39;ui-icon-pin-s&#39;,</p>
<p>onClickButton:function(){</p>
<p>myGrid[0].toggleToolbar()</p>
<p>}</p>
<p>})</p>
<p>.jqGrid(&#39;navButtonAdd&#39;,"#pager",{caption:"Clear",title:"Clear Search",buttonicon :&#39;ui-icon-refresh&#39;,</p>
<p>onClickButton:function(){</p>
<p>myGrid[0].clearToolbar();</p>
<p>jQuery(&#39;#list&#39;).data(&#39;selid&#39;, "");</p>
<p>jQuery(&#39;#list&#39;).data(&#39;firstname&#39;, "");</p>
<p>jQuery(&#39;#list&#39;).data(&#39;lastname&#39;, "");</p>
<p>jQuery(&#39;#list&#39;).data(&#39;address1&#39;, "");</p>
<p>jQuery(&#39;#list&#39;).data(&#39;address2&#39;, "");</p>
<p>jQuery(&#39;#list&#39;).data(&#39;city&#39;, "");</p>
<p>jQuery(&#39;#list&#39;).data(&#39;state&#39;, "");</p>
<p>jQuery(&#39;#list&#39;).data(&#39;zip&#39;, "");</p>
<p>jQuery(&#39;#list&#39;).data(&#39;phone&#39;, "");</p>
<p>jQuery(&#39;#list&#39;).data(&#39;email&#39;, "");</p>
<p>jQuery(&#39;#list&#39;).data(&#39;cell&#39;, "");</p>
<p>}</p>
<p>})</p>
<p>.jqGrid(&#39;filterToolbar&#39;);</p>
<p>/***********************************************************</p>
<p>*********************jqgrid*********************************</p>
<p>***********************************************************/</p>
]]></description>
        	        	<pubDate>Sat, 04 May 2013 01:08:25 +0300</pubDate>
        </item>
</channel>
</rss>