<?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: Help: Adding new row via Inline Editing</title>
	<link>http://www.trirand.com/blog/?page_id=393/discussion/help-adding-new-row-via-inline-editing</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/discussion/help-adding-new-row-via-inline-editing/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>EricT on Help: Adding new row via Inline Editing</title>
        	<link>http://www.trirand.com/blog/?page_id=393/discussion/help-adding-new-row-via-inline-editing#p18727</link>
        	<category>Discussion</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/discussion/help-adding-new-row-via-inline-editing#p18727</guid>
        	        	<description><![CDATA[</p>
<p>Hello,</p>
<p>The issue that I am having is when I attempt to add a new row to a grid and enable it for inline editing the record dissapears due to a grid refresh before I can select it for editing.</p>
<p><input type='button' class='sfcodeselect' name='sfselectit2168' value='Select Code' data-codeid='sfcode2168' /></p>
<div class='sfcode' id='sfcode2168'>jQuery(&#34;#myGrid&#34;).addRowData(0,{id:&#34;0&#34;,date:getToday(),&#8230;}, &#34;last&#34;);<br />jQuery(&#34;#myGrid&#34;).editRow(0,true);</div>
<p>This is the general shape of my grid definition with the relevent fields are listed below:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit1945' value='Select Code' data-codeid='sfcode1945' /></p>
<div class='sfcode' id='sfcode1945'>// Refreshes my grid when called<br />function refreshGrid()<br /> {<br /> &#160;&#160; &#160;var userID = jQuery(&#34;#empSelect&#34;).val();<br /> &#160;&#160; &#160;<br /> &#160;&#160; &#160;jQuery(&#34;#timeGrid&#34;).jqGrid(&#39;setGridParam&#39;,<br />&#160;&#160; &#160;&#160;&#160;&#160; {postData: { action:  &#34;requestData&#34;, where: &#34;userID = &#34;+userID+&#34; }});<br /> &#160;&#160; &#160;jQuery(&#34;#timeGrid&#34;).setGridParam({ datatype: &#39;json&#39;  }).trigger(&#34;reloadGrid&#34;);<br /> }</p>
<p>// Build my grid<br />jQuery(&#34;#myGrid&#34;).jqGrid(<br />{<br />&#160;&#160;&#160; url:&#39;dir/myHandler.ajax.php&#39;,<br />&#160;&#160;&#160; editurl:&#39;dir/myHandler.ajax.php&#39;,<br />&#160;&#160;&#160; datatype: &#39;json&#39;,<br />&#160;&#160;&#160; mtype: &#39;POST&#39;,<br />&#160;&#160;&#160; colNames:[...],<br />&#160;&#160;&#160; colModel:[...],<br />&#160;&#160;&#160; pager: jQuery(&#39;#pager&#39;),<br />&#160;&#160;&#160; loadonce: true,<br />&#160;&#160;&#160; viewrecords: true<br />});</p>
<p>// When Add New Record is clicked<br />jQuery(&#39;input[value=New Record]&#39;).click(function()<br />{<br />&#160;&#160;&#160; jQuery(&#34;#timeGrid&#34;).setGridParam({datatype: &#39;local&#39;, loadonce: true}); // Stop refresh?<br />&#160;&#160;&#160; jQuery(&#34;#timeGrid&#34;).addRowData(0,{id:&#34;0&#34;,entryDate:getToday(),&#8230;}, &#34;last&#34;); // Insert blank record<br />&#160;&#160;&#160; jQuery(&#34;#timeGrid&#34;).editRow(0,true); // Activate record for editing<br />});</p>
</div>
<p>So my question is: how do i prevent the grid from reloading while allowing the user to enter data in inline editing mode?</p>
<p>Thanks in advace!</p>
<p>- Eric</p>
]]></description>
        	        	<pubDate>Thu, 22 Jul 2010 02:02:42 +0300</pubDate>
        </item>
</channel>
</rss>