<?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: Issue with SaveRow(); Please help. Will pay!</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/issue-with-saverow-please-help-will-pay</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/issue-with-saverow-please-help-will-pay/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>jonaofarc on Issue with SaveRow(); Please help. Will pay!</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/issue-with-saverow-please-help-will-pay#p20358</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/issue-with-saverow-please-help-will-pay#p20358</guid>
        	        	<description><![CDATA[<p>Whoever gets this gets a beer.</p>
</p>
<p>Upon OnSelectRow, Iam trying to produce an alert from the callback function hello once saved, what am I doing wrong.(script below)</p>
<p>It may be that Iam a little confused as to how to use the save row API method.</p>
</p>
<p><strong>Heres what I have:</strong></p>
<p>jQuery("#rowed3").jqGrid(&#39;saveRow&#39;,id, hello, url, rowList, hello,hello, hello);</p>
</p>
<p><strong>My Questions:</strong></p>
<p>A) Do I have to have all the parameters in the saveRow method for the function to work?</p>
<p>B) Where does the hello(); function have to be located for it to work?</p>
<p>C) How can I see the ajax data being sent to the server? Meaning upon using the SaveRow function what array or data is being sent to server?</p>
<p>D) How to I properly use SaveRow in my script , Iam trying to get an alert() to set off within the hello function once the function SaveRow has been executed.</p>
<p><strong>My Script:</strong></p>
<p>$(document).ready(function() {<br />var lastsel;<br />function hello() {<br />&#160;&#160; &#160;<br />alert("Done");&#160;&#160; &#160;<br />&#160;&#160; &#160;<br />}<br />jQuery("#rowed3").jqGrid({<br />&#160; &#160;&#160;&#160; &#160;url:&#39;<a href="http://charmednetworks.com/grid_project/myproject/json/json.php&#038;#39" rel="nofollow" target="_blank"><a href="http://charmednetworks.com/gri" rel="nofollow">http://charmednetworks.com/gri</a>.....p&#038;#39</a>;,<br />&#160;&#160; &#160;datatype: "json",<br />&#160; &#160;&#160;&#160; &#160;colNames:[&#39;Actions&#39;,&#39;Inv No&#39;,&#39;Date&#39;, &#39;Client&#39;, &#39;Amount&#39;,&#39;Tax&#39;,&#39;Total&#39;,&#39;Notes&#39;],<br />&#160; &#160;&#160;&#160; &#160;colModel:[<br />&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;act&#39;,index:&#39;act&#39;, width:75,sortable:false},<br />&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;id&#39;,index:&#39;id&#39;, width:90},<br />&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;invdate&#39;,index:&#39;invdate&#39;, width:120, editable:true},<br />&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;name&#39;,index:&#39;name&#39;, width:100,editable:true},<br />&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;amount&#39;,index:&#39;amount&#39;, width:80, align:"right",editable:true},<br />&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;tax&#39;,index:&#39;tax&#39;, width:80, align:"right",editable:true},&#160;&#160; &#160;&#160;&#160; &#160;<br />&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;total&#39;,index:&#39;total&#39;, width:80,align:"right",editable:true},&#160;&#160; &#160;&#160;&#160; &#160;<br />&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;note&#39;,index:&#39;note&#39;, width:120, sortable:false,editable:true}&#160;&#160; &#160;&#160;&#160; &#160;<br />&#160; &#160;&#160;&#160; &#160;],<br />&#160; &#160;&#160;&#160; &#160;rowNum:10,<br />&#160; &#160;&#160;&#160; &#160;rowList:[10,20,30],<br />&#160; &#160;&#160;&#160; &#160;pager: &#39;#prowed3&#39;,<br />&#160; &#160;&#160;&#160; &#160;sortname: &#39;id&#39;,<br />&#160;&#160;&#160; viewrecords: true,<br />&#160;&#160;&#160; sortorder: "desc",<br />&#160;&#160; &#160;onSelectRow: function(id){<br />&#160;&#160; &#160;&#160;&#160; &#160;if(id &#38;&#38; id!==lastsel){<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;jQuery(&#39;#rowed3&#39;).jqGrid(&#39;restoreRow&#39;,lastsel); <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;jQuery(&#39;#rowed3&#39;).jqGrid(&#39;editRow&#39;,id,true); <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;jQuery("#rowed3").jqGrid(&#39;saveRow&#39;,id, hello, url, rowList, hello,hello, hello);<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;lastsel=id;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;alert(id);<br />&#160;&#160; &#160;&#160;&#160; &#160;}<br />&#160;&#160; &#160;},<br />&#160;&#160; &#160;gridComplete: function(){<br />&#160;&#160; &#160;&#160;&#160; &#160;var ids = jQuery("#rowed3").jqGrid(&#39;getDataIDs&#39;);<br />&#160;&#160; &#160;&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;for(var i=0;i &#60; ids.length;i++){<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;var cl = ids[i]; <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;be = "&#60;input style=&#39;height:22px;width:20px;&#39; type=&#39;button&#39; value=&#39;E&#39; onclick="jQuery(&#39;#rowed3&#39;).editRow(&#39;"+cl+"&#39;);" &#62;"; <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;se = "&#60;input style=&#39;height:22px;width:20px;&#39; type=&#39;button&#39; value=&#39;S&#39; onclick="jQuery(&#39;#rowed3&#39;).saveRow(&#39;"+cl+"&#39;);"&#160; &#62;"; <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;ce = "&#60;input style=&#39;height:22px;width:20px;&#39; type=&#39;button&#39; value=&#39;C&#39; onclick="jQuery(&#39;#rowed3&#39;).restoreRow(&#39;"+cl+"&#39;);" &#62;"; <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;jQuery("#rowed3").jqGrid(&#39;setRowData&#39;,ids[i],{act:be+se+ce});<br />&#160;&#160; &#160;&#160;&#160; &#160;}&#160;&#160; &#160;<br />&#160;&#160; &#160;},<br />&#160;&#160; &#160;editurl: "http://charmednetworks.com/grid_project/myproject/json/json.php",<br />&#160;&#160; &#160;caption: "Problems",<br />&#160;&#160; &#160;toolbar: [true,"top"]<br />&#160;&#160; &#160; &#160;<br />});<br />jQuery("#rowed3").jqGrid(&#39;navGrid&#39;,"#prowed3",{edit:false,add:false,del:false}); </p>
<p>$("#t_rowed3").append("&#60;input type=&#39;button&#39; value=&#39;Add Row&#39; style=&#39;height:40px;font-size:-3;&#39;/&#62;"); $("input","#t_rowed3").click(<br />&#160;&#160; &#160;function(id){ <br />&#160;&#160; &#160;&#160;&#160; &#160;var datarow = { id:"",<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;invdate:"",<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;name:"",<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;amount:"",<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;tax:"",<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;total:"",<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;note:""}; <br />&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; var lastsel2 = id;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; var su= jQuery("#rowed3").addRowData(4, datarow, "first") ;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;alert(su); <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160; if (su) { &#160;&#160; &#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; var edit = jQuery(&#39;#rowed3&#39;).editRow(4,true,&#39;<a href="http://charmednetworks.com/grid_project/myproject/json/json.php&#038;#39" rel="nofollow" target="_blank">http://charmednetworks.com/grid_project/myproject/json/json.php&#038;#39</a>;);&#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;&#160;&#160; &#160;&#160; if(su) {<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; &#160;&#160;&#160; &#160;alert();<br />&#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;&#160;&#160; &#160;&#160; } <br />&#160;&#160; &#160;&#160;&#160; &#160;//jQuery("#rowed3").jqGrid(&#39;editGridRow&#39;,"new",{height:280,reloadAfterSubmit:false});<br />&#160;&#160; &#160;}); <br />});</p></p>
]]></description>
        	        	<pubDate>Tue, 19 Oct 2010 02:19:18 +0300</pubDate>
        </item>
</channel>
</rss>