<?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: SaveRow doesn't post data</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/saverow-doesnt-post-data</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/saverow-doesnt-post-data/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>sumeshbabu on SaveRow doesn't post data</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/saverow-doesnt-post-data#p24400</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/saverow-doesnt-post-data#p24400</guid>
        	        	<description><![CDATA[<p>I am using thus jQuery grid plugin in my rails application.</p>
<p>I also want to use a single &#39;Submit&#39; button to update the modified records.</p>
<p>I &#160;have added the above code snippet to my code, but I got an error in the line</p>
<p>$.each(rowArr, function(index, value)</p>
<p>Error I got in firebug is &#160;&#39;$.each is not a function &#39;.</p>
<p>Please help me.</p>
]]></description>
        	        	<pubDate>Wed, 24 Aug 2011 16:45:43 +0300</pubDate>
        </item>
        <item>
        	<title>nalpolos on SaveRow doesn't post data</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/saverow-doesnt-post-data#p19709</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/saverow-doesnt-post-data#p19709</guid>
        	        	<description><![CDATA[<p>My Problem is solved.</p>
</p>
<p>I had to Edit the row before i save it. I found this solution by debugging the code of jqGrid (hard work ;-)).</p>
<p>Maybe it is a dirty workaround but i&#39;ve found &#160;no better solution.</p>
</p>
<p>So instead fo calling</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit6738' value='Select Code' data-codeid='sfcode6738' /></p>
<div class='sfcode' id='sfcode6738'>jQuery(&#39;#editoffer&#39;).saveRow( rowID, checkSaveResponse, &#34;&#60;c:url value=&#39;/settings/FormSettingsServlet&#39;/&#62;&#34;, {}, null, handleSaveErrors);</div>
</p>
<p>now i call</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit8331' value='Select Code' data-codeid='sfcode8331' /></p>
<div class='sfcode' id='sfcode8331'><strong>jQuery(&#39;#editoffer&#39;).editRow(rowID);<br /></strong><br /> jQuery(&#39;#editoffer&#39;).saveRow( rowID, checkSaveResponse, &#34;&#60;c:url value=&#39;/settings/FormSettingsServlet&#39;/&#62;&#34;, {}, null, handleSaveErrors);</div>
<p>Maybe this post will help someone else too.</p>
]]></description>
        	        	<pubDate>Sat, 11 Sep 2010 14:34:35 +0300</pubDate>
        </item>
        <item>
        	<title>nalpolos on SaveRow doesn't post data</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/saverow-doesnt-post-data#p19689</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/saverow-doesnt-post-data#p19689</guid>
        	        	<description><![CDATA[<p>Hi,</p>
<p>i have a simple JQgrid with some data, loaded from server. Two of the columns can be modified.</p>
<p>Additionally a have a "save"-Button that runs through all rows and calls the saveRow-Method for posting each row to the server:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit8901' value='Select Code' data-codeid='sfcode8901' /></p>
<div class='sfcode' id='sfcode8901'>
<p>$(&#39;#safeOfferSettingsButton&#39;).click(function() {</p>
<p> var changedRowsArr = jQuery(&#34;#editoffer&#34;).getChangedCells(&#39;all&#39;);<br /> addMessage(&#34;&#60;b&#62;SAVE: changed rows: &#34; + changedRowsArr.length + &#34;&#60;/b&#62;&#34;);</p>
<p> // run throug all rows and send save-requests.<br /> var rowArr = jQuery(&#34;#editoffer&#34;).getRowData();<br /> $.each(rowArr, function(index, value){<br /> addMessage(&#34;... saving &#34; + value[&#34;id&#34;]);<br /> //jQuery(&#39;#editoffer&#39;).saveRow(value[&#34;id&#34;], false, &#39;&#60;c:url value=&#34;/settings/FormSettingsServlet&#34;/&#62;&#39;);<br /> //jQuery(&#39;#editoffer&#39;).jqGrid(&#39;saveRow&#39;, value[&#34;id&#34;], checkSaveResponse, &#34;&#60;c:url value=&#39;/settings/FormSettingsServlet&#39;/&#62;&#34;);<br />&#160;jQuery(&#39;#editoffer&#39;).jqGrid(&#39;saveRow&#39;, value[&#34;id&#34;] , checkSaveResponse);<br /> }<br />&#160;);<br />});</p>
</div>
<p>The Method addMessage &#160;displays content in a seperate &#60;div&#62; for debugging. The array contains the correct data, but calling the saveRow Method does noting. It doesn&#39;t post data to the server.</p>
<p>Can somebody help?</p>
</p>
<p>Thanks.</p>
<p>Here&#39;s the complete code:</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit8265' value='Select Code' data-codeid='sfcode8265' /></p>
<div class='sfcode' id='sfcode8265'>
<p>&#60;!-- <br />********************************<br /> The grid <br />********************************<br />--&#62;<br />&#60;table id=&#34;editoffer&#34;&#62;&#60;/table&#62;<br />&#60;script type=&#34;text/javascript&#34;&#62;<br />var lastSelectedID;<br />jQuery(&#34;#editoffer&#34;).jqGrid(<br /> { url: &#34;/myServlets/FormSettingsServlet?mode=xml&#34;, /* url for getting the data  in xml format*/<br /> datatype: &#34;xml&#34;, <br /> mtype:&#34;post&#34;,   <br /> height: 250, <br /> colNames:[&#39;No&#39;,&#39;Name&#39;, &#39;Visible&#39;, &#39;Required&#39;], <br /> colModel:[ <br /> {name:&#39;id&#39;,       index:&#39;id&#39;,       width:60,   sortable:false, hidden:false}, <br /> {name:&#39;name&#39;,     index:&#39;name&#39;,     width:300,  sortable:false, editable:false}, <br /> {name:&#39;visible&#39;,  index:&#39;visible&#39;,  width:40,   sortable:false, editable:true, edittype:&#39;checkbox&#39;, editoptions: { value:&#34;true:false&#34;}, formatter: booleanImageFormatter,  unformat:booleanImageUnFormatter,   align:&#39;center&#39;},<br /> {name:&#39;required&#39;, index:&#39;required&#39;, width:40,   sortable:false, editable:true, edittype:&#39;checkbox&#39;, editoptions: { value:&#34;true:false&#34;}, formatter: booleanImageFormatter,  unformat:booleanImageUnFormatter, align:&#39;center&#39;}],</p>
<p> /** <br /> * Do not start edit. Just negate the current value. <br /> * This is done in order to change checkbox-values by one click:<br /> * Process only clicks on column-index 2 and 3.<br /> */<br /> onCellSelect: function(rowid, iCol, cellcontent, e){<br /> addMessage(&#34;trying to change selection... rowid:&#34;+rowid+&#34; last id:&#34; + lastSelectedID + &#34;  -&#62;iCol: &#34; + iCol);</p>
<p> var colName = &#34;&#34;;<br /> if (iCol == 2){colName =&#34;visible&#34;; }<br /> else if (iCol == 3){colName =&#34;required&#34;;}</p>
<p> if (iCol != &#34;&#34;){<br /> // get the row<br /> var tRowDataArray = jQuery(&#39;#editoffer&#39;).getRowData(rowid);<br /> addArrMessage(tRowDataArray);<br /> addMessage(&#34;&#60;b&#62;current Value: \&#34;&#34; + tRowDataArray[colName] + &#34;\&#34;&#60;/b&#62;&#34;);</p>
<p> // invert the value<br /> tRowDataArray[colName] = &#34;&#34; + (&#34;true&#34; != tRowDataArray[colName]);<br /> addMessage(&#34;&#60;b style=&#39;color:#aabbff;&#39;&#62;new Value: \&#34;&#34; + tRowDataArray[colName] + &#34;\&#34;&#60;/b&#62;&#34;);</p>
<p> // Set date to refresh.<br /> jQuery(&#39;#editoffer&#39;).setRowData(rowid,tRowDataArray);<br /> }<br /> }, <br /> editurl: &#34;/myServlets/FormSettingsServlet?mode=xml&#34;,	<br /> multiselect: false, <br /> viewrecords: true, rowNum:200, autowidth: true,<br /> caption: &#34;Testdata&#34; });</p>
<p>/**<br />* Display an image that looks like a checkbox<br />*/<br />function booleanImageFormatter (cellvalue, options, rowObject){<br /> var trimmed = jQuery.trim(cellvalue);<br /> if (trimmed == &#34;true&#34;){<br /> return &#34;&#60;div class=\&#34;centered-cell dummy-check\&#34;&#62;&#60;span class=\&#34;solo-icons solo-icon-check\&#34; onMouseOver&#62;&#38;nbsp&#60;/span&#62;&#60;/div&#62;&#34;;<br /> }<br /> else{<br /> return &#34;&#60;div class=\&#34;centered-cell dummy-uncheck\&#34;&#62;&#60;span class=\&#34;solo-icons solo-icon-uncheck\&#34;&#62;&#38;nbsp&#60;/span&#62;&#60;/div&#62;&#34;;<br /> }<br />}</p>
<p>/**<br />* Return the booleanvalue of the formatted content<br />*/<br />function booleanImageUnFormatter (cellvalue, options, cellobject){<br /> var imgID;<br /> try{<br /> imgID = $(cellobject.firstChild).hasClass(&#34;dummy-check&#34;);<br /> }<br /> catch(e){<br /> alert(e);<br /> }<br /> // important to return a string-value <br /> return &#34;&#34; + imgID;<br />}<br />&#60;/script&#62;</p>
<p>&#60;!-- <br />********************************<br /> Submitt-button<br />********************************<br />--&#62;<br />&#60;input type=&#34;button&#34; name=&#34;button&#34; value=&#34;Speichern&#34; id=&#34;safeOfferSettingsButton&#34; class=&#34;ui-button ui-state-default ui-corner-all ui-button-text-only&#34;&#62;<br />&#60;script type=&#34;text/javascript&#34;&#62;<br />$(&#39;#safeOfferSettingsButton&#39;).click(function() {</p>
<p> var changedRowsArr = jQuery(&#34;#editoffer&#34;).getChangedCells(&#39;all&#39;);<br /> addMessage(&#34;&#60;b&#62;SAVE: changed rows: &#34; + changedRowsArr.length + &#34;&#60;/b&#62;&#34;);</p>
<p> // run throug all rows and send save-requests.<br /> var rowArr = jQuery(&#34;#editoffer&#34;).getRowData();<br /> $.each(rowArr, function(index, value){<br /> addMessage(&#34;... saving &#34; + value[&#34;id&#34;]);</p>
<p> //jQuery(&#39;#editoffer&#39;).jqGrid(&#39;saveRow&#39;, value[&#34;id&#34;], checkSaveResponse, &#34;/myServlets/FormSettingsServlet&#34;);<br /> //jQuery(&#39;#editoffer&#39;).saveRow(value[&#34;id&#34;], false, &#39;/myServlets/FormSettingsServlet&#39;);<br /> jQuery(&#39;#editoffer&#39;).jqGrid(&#39;saveRow&#39;, &#39;&#39;+value[&#34;id&#34;] , checkSaveResponse);<br /> }<br /> );</p>
<p>});</p>
<p>function checkSaveResponse(result) {<br /> if (result.responseText==&#34;&#34;){<br /> addMessage(&#34;&#60;span  style:\&#34;color:red;\&#34;&#62;update is missing&#60;/span&#62;&#34;);<br /> }<br /> else{<br /> addMessage(&#34;&#60;span  style:\&#34;color:green;\&#34;&#62;success&#60;/span&#62;&#34;);<br /> }<br /> return true;<br /> }<br />&#60;/script&#62;</p>
<p>&#60;!-- <br />********************************<br /> This is an area for <br /> debug-messages<br />********************************<br />--&#62;<br />&#60;div id=&#34;messages&#34; style=&#34;font-size:10px; border : solid 2px #555555; background : #000000; color : #bbbbbb; padding : 4px; width : 100%; height : 300px; overflow : auto;&#34;&#62;&#38;nbsp;&#60;/div&#62;<br />&#60;input type=&#34;button&#34; name=&#34;button&#34; value=&#34;clear&#34; id=&#34;clearConsoleMessages&#34; class=&#34;ui-button ui-state-default ui-corner-all ui-button-text-only&#34;&#62;<br />&#60;script type=&#34;text/javascript&#34;&#62;<br />function addMessage(aMessage){<br /> $(&#39;#messages&#39;).html($(&#39;#messages&#39;).html() + aMessage  +  &#34;&#60;br&#62;&#34;);<br />}</p>
<p>function addArrMessage(aArrayData){<br /> var MessageString = &#34;&#34;;<br /> $.each(aArrayData, function(key, val){<br /> MessageString = MessageString +  key + &#34;: &#34; + val + &#34;, &#34;;<br /> });<br /> addMessage( &#34;&#38;nbsp;-&#62; &#34; + MessageString);<br /> }</p>
<p>$(&#39;#clearConsoleMessages&#39;).click(function(){<br /> $(&#39;#messages&#39;).html(&#34;&#34;);  <br />});<br />&#60;/script&#62;</p>
</div>
]]></description>
        	        	<pubDate>Sat, 11 Sep 2010 11:00:24 +0300</pubDate>
        </item>
</channel>
</rss>