<?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: Add a row</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/add-a-row</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/add-a-row/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tony on Add a row</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/add-a-row#p10125</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/add-a-row#p10125</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>You call click button with in jqGrid parameters. This is wrong. The click event should be outside grid parameters</p>
<p>To have Add button you will neeed to call editGridRow with _empty id. See docs and examples.</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Fri, 25 Sep 2009 04:33:35 +0300</pubDate>
        </item>
        <item>
        	<title>tony on Add a row</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/add-a-row#p10124</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/add-a-row#p10124</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>You call click button with in jqGrid parameters. This is wrong. The click event should be outside grid parameters</p>
<p>To have Add button you will neeed to call editGridRow with _empty id. See docs and examples.</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Fri, 25 Sep 2009 04:29:48 +0300</pubDate>
        </item>
        <item>
        	<title>violinssoundcool on Add a row</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/add-a-row#p10015</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/add-a-row#p10015</guid>
        	        	<description><![CDATA[<p>Hi.&#160; I&#39;m trying to get the &#8220;Add Row&#8221; function to work, but I just don&#39;t really understand the concept of what needs to happen.&#160; The grid itself works fine.&#160; I&#39;m still working on the edit, delete, and print buttons.&#160; On the demonstration page, it looks like the code for the &#8220;Edit Row&#8221; button is included instead of the &#8220;Add Row.&#8221;&#160; I get that I&#39;ll need to add a button below the pager that has an id of &#8220;bedata&#8221; and add a .click() function for it, but I don&#39;t know what&#39;s supposed to happen in this function or how to design the form that is presented.&#160; I tried reading the wiki for documentation, but just can&#39;t seem to understand what needs to happen.&#160; Can you guys give an explanation of what needs to happen?</p>
</p>
<p>Here&#39;s my code if that helps:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit7138' value='Select Code' data-codeid='sfcode7138' /></p>
<div class='sfcode' id='sfcode7138'>&#60;!&#8211;$top$&#8211;&#62;<br />Content-type: text/html</p>
<p>&#60;!DOCTYPE html PUBLIC &#8220;-//W3C//DTD XHTML 1.0 Strict//EN&#8221; &#8220;<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&#8221;&#038;gt" rel="nofollow" target="_blank"><a href="http://www.w3.org/TR/xhtml1/DT" rel="nofollow">http://www.w3.org/TR/xhtml1/DT</a>.....o;&#038;gt</a>;<br />&#160;&#160;&#160; &#160;&#160;&#160; <br />&#60;html xmlns=&#8221;<a href="http://www.w3.org/1999/xhtml&#038;rdquo" rel="nofollow" target="_blank">http://www.w3.org/1999/xhtml&#038;rdquo</a>; xml:lang=&#8221;en&#8221; lang=&#8221;en&#8221;&#62;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; <br />&#60;head&#62;<br />&#160;&#160;&#160; &#60;META http-equiv=&#8221;Content-Type&#8221; content=&#8221;text/html; charset=utf-8&#8243;&#62;<br />&#160;&#160;&#160; &#60;title&#62;General Ledger&#60;/title&#62;<br />&#160;&#160;&#160; <br />&#160;&#160;&#160; &#60;link rel=&#8221;stylesheet&#8221; type=&#8221;text/css&#8221; media=&#8221;screen&#8221; href=&#8221;/GL/css/sabel/jquery-ui-1.7.2.custom.css&#8221; /&#62;<br />&#160;&#160;&#160; &#60;link rel=&#8221;stylesheet&#8221; type=&#8221;text/css&#8221; media=&#8221;screen&#8221; href=&#8221;/GL/css/ui.jqgrid.css&#8221; /&#62;<br />&#160;&#160;&#160; &#60;link rel=&#8221;stylesheet&#8221; href=&#8221;/CSS_GL/main.css&#8221; type=&#8221;text/css&#8221;&#62;<br />&#160;&#160;&#160; &#160;<br />&#160;&#160;&#160; &#60;script src=&#8221;/GL/js/jquery-1.3.2.min.js&#8221; type=&#8221;text/javascript&#8221;&#62;&#60;/script&#62;<br />&#160;&#160;&#160; &#60;script src=&#8221;/GL/js/i18n/grid.locale-en.js&#8221; type=&#8221;text/javascript&#8221;&#62;&#60;/script&#62;<br />&#160;&#160;&#160; &#60;script src=&#8221;/GL/js/jquery.jqGrid.min.js&#8221; type=&#8221;text/javascript&#8221;&#62;&#60;/script&#62;</p>
<p>&#160;&#160;&#160; &#60;script type=&#8221;text/javascript&#8221;&#62;<br />&#160;&#160;&#160; &#160;&#160;&#160; $(document).ready(function()<br />&#160;&#160;&#160; &#160;&#160;&#160; {<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; var columnNames = [&#39;Option&#39;,&#39;Batch&#39;,&#39;Company&#39;,&#39;Posting Date&#39;,&#39;Date Batch Created&#39;,&#39;Created By User&#39;, &#39;Status&#39;];<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; var columnModel = [<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;act&#39;,&#160; index:&#39;act&#39;, width:130, align:&#39;center&#39;, resizable:false, sortable:false},<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;batch&#39;, index:&#39;batch&#39;, width:100, align:&#39;center&#39;, resizable:false, sortable:false},<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;company&#39;, index:&#39;company&#39;,&#160; width:100, align:&#39;center&#39;, resizable:false, sortable:false},<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;postingDate&#39;, index: &#39;postingDate&#39;, width:100, align:&#39;center&#39;, resizable:false, sortable:false},<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;dateBatchCreated&#39;, index:&#39;dateBatchCreated&#39;, width:120, align:&#39;center&#39;, resizable:false, sortable:false},<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;createdByUser&#39;, index:&#39;createdByUser&#39;, width:100, align:&#39;center&#39;, resizable:false, sortable:false},<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;status&#39;, index:&#39;status&#39;, width:50, align:&#39;center&#39;, resizable:false, sortable:false}<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; ];<br />&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160; var gridwidth = $(&#39;.table&#39;).width();</p>
<p>&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; var lastsel;</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; $(&#8221;#batches&#8221;).jqGrid(<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {<br />&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; url: &#8220;GL0002B&#8221;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; datatype: &#8220;json&#8221;,<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; mtype: &#39;GET&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; colNames: columnNames,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; colModel: columnModel,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; pager: jQuery(&#39;#pager2&#39;),<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; pgtext: &#39; of&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; rowNum: 20,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; rowList: [5,10,15,20],<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; imgpath: &#8220;/GL/css/sabel/images&#8221;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; sortname: &#39;dateBatchCreated&#39;,<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; sortorder: &#8220;asc&#8221;,<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; loadComplete: <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; function()<br />&#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; var ids = jQuery(&#8221;#batches&#8221;).getDataIDs(); <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#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; &#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;&#160;&#160; var cl = ids[i]; <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; be = &#8220;&#60;input style=&#39;height:22px;width:40px;&#39; type=&#39;button&#39; value=&#39;Edit&#39; onclick=$(&#39;#batches&#39;).editRow(&#8221;+cl+&#8221;); &#62;&#60;/ids&#62;&#8221;; <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; se = &#8220;&#60;input style=&#39;height:22px;width:50px;&#39; type=&#39;button&#39; value=&#39;Delete&#39; onclick=$(&#39;#batches&#39;).deleteRow(&#8221;+cl+&#8221;); /&#62;&#8221;; <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; ce = &#8220;&#60;input style=&#39;height:22px;width:70px;&#39; type=&#39;button&#39; value=&#39;Print Edit&#39; onclick=$(&#39;#batches&#39;).printRow(&#8221;+cl+&#8221;); /&#62;&#8221;; <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; jQuery(&#8221;#batches&#8221;).setRowData(ids[i],{act:be+se+ce}) <br />&#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; }, <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; editurl: &#8220;GL0002C&#8221;, &#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; viewrecords: true,<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; caption: &#8220;Journal Entry Batches&#8221;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; width: gridwidth,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; height: &#39;300px&#39;,<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; multiselect: false,<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; editurl: &#8220;GL0002C&#8221;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; shrinkToFit: true, <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; jsonReader : <br />&#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; root: &#8220;rows&#8221;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; page: &#8220;page&#8221;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; total: &#8220;total&#8221;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; records: &#8220;records&#8221;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; repeatitems : false<br />&#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; });<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; $(&#39;#bedata&#39;).click(function()<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; var gr = $(&#39;#editgrid&#39;).getGridParam(&#39;selrow&#39;);<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; if( gr != null ) $(&#39;#editgrid&#39;).editGridRow(gr,{height:280,reloadAfterSubmit:false});<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; else alert(&#39;Please Select Row&#39;);<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; });<br />}).navGrid(&#8221;#pager2&#8243;,{edit:false,add:false,del:false}); <br />&#160;&#160;&#160; &#60;/script&#62;&#160;&#160;&#160; <br />&#60;/head&#62;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; <br />&#60;body&#62;<br />&#160;&#160;&#160; &#60;div class=&#8221;container&#8221; id=&#8221;container&#8221;&#62;&#160;&#160;&#160; <br />&#160;&#160;&#160; &#160;&#160;&#160; &#60;div class=&#8221;header&#8221;&#62;&#60;/div&#62;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#60;div class=&#8221;menuBar&#8221;&#62;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#60;ul&#62;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#60;li&#62;&#60;a href=&#8221;"&#62;Journal Processing&#60;/a&#62;&#60;/li&#62;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#60;li&#62;&#60;a href=&#8221;"&#62;File Maintenance&#60;/a&#62;&#60;/li&#62;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#60;li&#62;&#60;a href=&#8221;"&#62;Inquiry&#60;/a&#62;&#60;/li&#62;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#60;li&#62;&#60;a href=&#8221;"&#62;Reports/Listings&#60;/a&#62;&#60;/li&#62;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#60;li&#62;&#60;a href=&#8221;"&#62;Month/Year End Close&#60;/a&#62;&#60;/li&#62;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#60;/ul&#62;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#60;/div&#62;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#60;div class=&#8221;content&#8221;&#62;&#60;br /&#62;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#60;div class=&#8221;table&#8221; id=&#8221;table&#8221;&#62;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; &#60;table id=&#8221;batches&#8221; class=&#8221;scroll&#8221; cellpadding=&#8221;0&#8243; cellspacing=&#8221;0&#8243; style=&#8221;margin-left: auto; margin-right: auto;&#8221;&#62;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; &#60;/table&#62;&#60;br /&#62;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; &#60;div id=&#8221;pager2&#8243; class=&#8221;scroll&#8221; style=&#8221;text-align: center; height: 35px;&#8221;&#62;&#60;/div&#62;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#60;input type=&#8221;BUTTON&#8221; id=&#8221;bedata&#8221; value=&#8221;Add Row&#8221; /&#62; <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#60;/div&#62;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#60;/div&#62;<br />&#160;&#160;&#160; &#60;/div&#62;<br />&#60;/body&#62;<br />&#60;/html&#62;</p>
</div>
]]></description>
        	        	<pubDate>Tue, 22 Sep 2009 15:15:55 +0300</pubDate>
        </item>
</channel>
</rss>