<?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 addrow to localdata and then batch save.</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/how-to-addrow-to-localdata-and-then-batch-save</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-addrow-to-localdata-and-then-batch-save/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tony on How to addrow to localdata and then batch save.</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-to-addrow-to-localdata-and-then-batch-save#p31117</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-to-addrow-to-localdata-and-then-batch-save#p31117</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Â </p>
<p>You do not need to call saveRow, since addRowData add a data direct to the grid.</p>
<p>Not sure what is happen with your code -I'm very confused with your code.</p>
<p>Â </p>
<p>Regards</p>
]]></description>
        	        	<pubDate>Sat, 13 Sep 2014 12:55:12 +0300</pubDate>
        </item>
        <item>
        	<title>HardCorps88 on How to addrow to localdata and then batch save.</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-to-addrow-to-localdata-and-then-batch-save#p31097</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-to-addrow-to-localdata-and-then-batch-save#p31097</guid>
        	        	<description><![CDATA[<p>Fixed my save issue up to a point.Â  Corrected code in my batch save but...when clicking my save button I can only get my current rows not my newrow I added.Â  I see all the ID's but not sure how to get my new row added to the batch or 'clientArray' in order to save.Â  In addition how do I add the Id's of each row including the new row to the batch?</p>
<p>parameters2 = {<br />
 Â Â Â Â Â Â Â  rowid: 'new_row',<br />
 Â Â Â Â Â Â Â  initdata:{<br />
 Â Â Â Â Â Â Â Â Â Â Â  EmpID: "1234",<br />
 Â Â Â Â Â Â Â Â Â Â Â  concatProjectTask: "Development",<br />
 Â Â Â Â Â Â Â Â Â Â Â  TaskId: "3",<br />
 Â Â Â Â Â Â Â Â Â Â Â  ActivityName: "Regular",<br />
 Â Â Â Â Â Â Â Â Â Â Â  Sun: 0,<br />
 Â Â Â Â Â Â Â Â Â Â Â  Mon: 0,<br />
 Â Â Â Â Â Â Â Â Â Â Â  Tue: 0,<br />
 Â Â Â Â Â Â Â Â Â Â Â  Wed: 0,<br />
 Â Â Â Â Â Â Â Â Â Â Â  Thu: 0,<br />
 Â Â Â Â Â Â Â Â Â Â Â  Fri: 0,<br />
 Â Â Â Â Â Â Â Â Â Â Â  Sat: 0,<br />
 Â Â Â Â Â Â Â Â Â Â Â  Sun2: 0,<br />
 Â Â Â Â Â Â Â Â Â Â Â  Mon2: 0,<br />
 Â Â Â Â Â Â Â Â Â Â Â  Tue2: 0,<br />
 Â Â Â Â Â Â Â Â Â Â Â  Wed2: 0,<br />
 Â Â Â Â Â Â Â Â Â Â Â  Thu2: 0,<br />
 Â Â Â Â Â Â Â Â Â Â Â  Fri2: 0,<br />
 Â Â Â Â Â Â Â Â Â Â Â  Sat2: 0,<br />
 Â Â Â Â Â Â Â Â Â Â Â  Total: 0<br />
 Â Â Â Â Â Â  },<br />
 Â Â Â Â Â Â Â  position: "last",<br />
 Â Â Â Â Â Â Â  edit: false<br />
 Â Â Â  }</p>
<p>function NewRow2() {<br />
 Â Â Â Â Â Â Â <br />
 Â Â Â Â Â Â Â  $("#grid2").jqGrid('addRow', parameters2);<br />
 Â Â Â Â Â Â <br />
 Â Â Â  }</p>
]]></description>
        	        	<pubDate>Mon, 08 Sep 2014 19:29:22 +0300</pubDate>
        </item>
        <item>
        	<title>HardCorps88 on How to addrow to localdata and then batch save.</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-to-addrow-to-localdata-and-then-batch-save#p31096</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-to-addrow-to-localdata-and-then-batch-save#p31096</guid>
        	        	<description><![CDATA[<p>I thought I did when I used this function?</p>
<p>function NewRow2() {<br />
 Â Â Â Â Â Â Â  var addNewRow = new Array();<br />
 Â Â Â Â Â Â Â  $("#grid2").jqGrid('addRowData', '6', parameters2);<br />
 Â Â Â Â Â Â <br />
 Â Â Â  }</p>
]]></description>
        	        	<pubDate>Mon, 08 Sep 2014 18:26:42 +0300</pubDate>
        </item>
        <item>
        	<title>tony on How to addrow to localdata and then batch save.</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-to-addrow-to-localdata-and-then-batch-save#p31087</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-to-addrow-to-localdata-and-then-batch-save#p31087</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Make sure that newly added row has a uniquie id. It seems yors are not.</p>
<p>Â </p>
<p>Regards</p>
]]></description>
        	        	<pubDate>Mon, 08 Sep 2014 14:31:28 +0300</pubDate>
        </item>
        <item>
        	<title>HardCorps88 on How to addrow to localdata and then batch save.</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-to-addrow-to-localdata-and-then-batch-save#p31057</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-to-addrow-to-localdata-and-then-batch-save#p31057</guid>
        	        	<description><![CDATA[<p>I can submit my grid no problem but when adding a new row it gets the id but not the data so its null.Â  How can I add my new row to my local dataset then post all in a batch save? I have included my code for reference.</p>
<p>parameters2 = {<br />
Â Â Â Â Â Â  Â <br />
Â Â Â Â Â Â  Â <br />
Â Â Â Â Â Â Â Â Â Â Â  EmpID: "1234",<br />
Â Â Â Â Â Â Â Â Â Â Â  concatProjectTask: "Development",<br />
Â Â Â Â Â Â Â Â Â Â Â  TaskId: "3",<br />
Â Â Â Â Â Â Â Â Â Â Â  ActivityName: "Regular",<br />
Â Â Â Â Â Â Â Â Â Â Â  Sun: 0,<br />
Â Â Â Â Â Â Â Â Â Â Â  Mon: 0,<br />
Â Â Â Â Â Â Â Â Â Â Â  Tue: 0,<br />
Â Â Â Â Â Â Â Â Â Â Â  Wed: 0,<br />
Â Â Â Â Â Â Â Â Â Â Â  Thu: 0,<br />
Â Â Â Â Â Â Â Â Â Â Â  Fri: 0,<br />
Â Â Â Â Â Â Â Â Â Â Â  Sat: 0,<br />
Â Â Â Â Â Â Â Â Â Â Â  Sun2: 0,<br />
Â Â Â Â Â Â Â Â Â Â Â  Mon2: 0,<br />
Â Â Â Â Â Â Â Â Â Â Â  Tue2: 0,<br />
Â Â Â Â Â Â Â Â Â Â Â  Wed2: 0,<br />
Â Â Â Â Â Â Â Â Â Â Â  Thu2: 0,<br />
Â Â Â Â Â Â Â Â Â Â Â  Fri2: 0,<br />
Â Â Â Â Â Â Â Â Â Â Â  Sat2: 0,<br />
Â Â Â Â Â Â Â Â Â Â Â  Total: 0,<br />
Â Â Â Â Â Â  Â <br />
Â Â Â Â Â Â Â  position: "last",<br />
Â Â Â Â Â Â Â  edit: false<br />
Â Â Â  }</p>
<p>function NewRow2() {<br />
Â Â Â Â Â Â Â  var addNewRow = new Array();<br />
Â Â Â Â Â Â Â  $("#grid2").jqGrid('addRowData', '6', parameters2);<br />
Â Â Â Â Â Â <br />
Â Â Â  }</p>
<p>Â function SaveAll2() {<br />
Â Â Â Â Â Â Â  var $grid = $('#grid2'),<br />
Â Â Â Â Â Â Â Â Â Â Â  editingRowId,<br />
Â Â Â Â Â Â Â Â Â Â Â  myEditParam = {<br />
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  keys: true,<br />
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  oneditfunc: function (id) { editingRowId = id; },<br />
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  afterrestorefunc: function (id) { editingRowId = undefined; }<br />
Â Â Â Â Â Â Â Â Â Â Â  };<br />
Â Â Â Â Â Â Â  var rowid = 0;<br />
Â Â Â Â Â Â Â  var localGridData = new Array();<br />
Â Â Â Â Â Â Â  var rows = $('#grid2').jqGrid('getDataIDs');<br />
Â Â Â Â Â Â Â  for (var i = 0; i &#60; rows.length; i++) {<br />
Â Â Â Â Â Â Â Â Â Â Â  $('#grid2').jqGrid('saveRow', rows[i], false, 'clientArray');<br />
Â Â Â Â Â Â Â Â Â Â Â  var data = $('#grid2').jqGrid('getGridParam', rows[i]);<br />
Â Â Â Â Â Â Â Â Â Â Â  localGridData.push(data);<br />
Â Â Â Â Â Â Â  }<br />
Â Â Â Â Â Â Â  var dataToSend = JSON.stringify(localGridData);<br />
Â Â Â Â Â Â Â  $.ajax({<br />
Â Â Â Â Â Â Â Â Â Â Â  type: "POST",<br />
Â Â Â Â Â Â Â Â Â Â Â  contentType: "application/json; charset=utf-8",<br />
Â Â Â Â Â Â Â Â Â Â Â  url: "Employee/SaveHours",<br />
Â Â Â Â Â Â Â Â Â Â Â  dataType: "json",<br />
Â Â Â Â Â Â Â Â Â Â Â  data: dataToSend,</p>
<p>Â Â Â Â Â Â Â Â Â Â Â  success: function (result) {<br />
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  alert("Success");<br />
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  $('#grid').trigger('reloadGrid');<br />
Â Â Â Â Â Â Â Â Â Â Â  },<br />
Â Â Â Â Â Â Â Â Â Â Â  error: function (jqXHR, textStatus, errorThrown) {<br />
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  $('#' + grid[0].id + '_err').remove();<br />
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  grid.closest('div.ui-jqgrid').before(<br />
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  '&#60;div id="' + grid[0].id + '_err" style="max-width:' + grid[0].style.width +<br />
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  ';"&#62;&#60;div class="ui-state-error ui-corner-all" style="padding:0.7em;float:left;"&#62;&#60;span class="ui-icon ui-icon-alert" ' +<br />
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  decodeErrorMessage(jqXHR, textStatus, errorThrown) + '&#60;/span&#60;?div&#60;div style="clear:left"/&#62;&#60;/div&#62;');<br />
Â Â Â Â Â Â Â Â Â Â Â  }</p>
<p>Â Â Â Â Â Â Â  });<br />
Â Â Â  }</p>
]]></description>
        	        	<pubDate>Thu, 04 Sep 2014 23:43:14 +0300</pubDate>
        </item>
</channel>
</rss>