<?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 insert a row for inline editing ?</title>
	<link>http://www.trirand.com/blog/?page_id=393/discussion/how-to-insert-a-row-for-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/how-to-insert-a-row-for-inline-editing/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>aznan on How to insert a row for inline editing ?</title>
        	<link>http://www.trirand.com/blog/?page_id=393/discussion/how-to-insert-a-row-for-inline-editing#p14114</link>
        	<category>Discussion</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/discussion/how-to-insert-a-row-for-inline-editing#p14114</guid>
        	        	<description><![CDATA[<p>well, thanx,&#8230; but nothing change&#8230;&#160;&#160; i still cant submit the data by using the enter key.. and all the other cell cant be edited once i press the enter key inside the cell in the new row.. FYI all other function works ok.. read data .. and works well with the predefined add, edit, delete, view&#8230;&#160; but i wish to do it by inserting the new row.. and then save the data just like the inline editing process..</p>
<p>i gave u the full code&#8230; hope u could help..thanx</p>
</p>
<p>&#60;script type=&#8221;text/javascript&#8221;&#62;<br />&#160; <br />jQuery(document).ready(function(){<br />&#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 />&#160;var lastSel; <br />&#160;<br />&#160; jQuery(&#8221;#list&#8221;).jqGrid({<br />&#160;&#160;&#160; url:&#39;jqgrid/data_claimdetail.php&#39;,<br />&#160;&#160;&#160; datatype: &#8220;json&#8221;,<br />&#160;&#160;&#160; colNames:[&#39;Claim Detail ID&#39;,&#39;Item&#39;, &#39;Claim ID&#39;, &#39;Date&#39;,&#39;Reference&#39;,&#39;Amount&#39;,&#39;Site ID&#39;,&#39;Acc ID&#39;],&#160;&#160;&#160; &#160;<br />&#160;&#160;&#160; colModel:[<br />&#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;int_claimdetailid&#39;,index:&#39;int_claimdetailid&#39;,&#160; align:"center", width:110, sortable:true},<br />&#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;txt_item&#39;,index:&#39;txt_item&#39;, editable:true,&#160; align:"center", width:150, stype:&#39;text&#39; },<br />&#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;int_claimid&#39;,index:&#39;int_claimid asc, txt_item&#39;,&#160; align:"center", width:50},<br />&#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;dt_date&#39;,index:&#39;dt_date&#39;, width:80, align:"center", editable: true,formatter:&#39;date&#39;,</p>
<p>editoptions:{dataInit:function(el){$(el).datepicker({dateFormat:&#39;yy-mm-dd&#39;});} }, formoptions:{ rowpos:2,&#160; elmsuffix:" * yyyy-mm-dd" } },<br />&#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;int_reference&#39;,index:&#39;int_reference&#39;, width:60, align:"center", editable: true,editoptions:{size:"20",maxlength:"30"}},<br />&#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;cur_amount&#39;,index:&#39;cur_amount&#39;, width:80, align:"right",editable: true, formatter:&#39;currency&#39;, formatoptions:{decimalSeparator:".", thousandsSeparator: ",", decimalPlaces: 2, prefix: "RM "}},<br />&#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;int_siteid&#39;,index:&#39;int_siteid&#39;, width:50, align:"center", editable: true,edittype:"checkbox",editoptions: {value:"1:2:3"}},<br />&#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;int_accid&#39;,index:&#39;int_accid&#39;, width:50, align:"center", sortable:false }&#160;&#160;&#160; <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; ], <br />&#160;&#160;&#160; pager: &#39;#pager&#39;, <br />&#160;&#160;&#160; rowNum:10,<br />&#160;&#160;&#160; rowList:[10,20,30],<br />&#160;&#160;&#160; height:250,<br />&#160;&#160;&#160; sortname: &#39;int_claimdetailid&#39;,<br />&#160;&#160;&#160; sortorder: &#39;desc&#39;,<br />&#160;&#160;&#160; viewrecords: true,&#160; <br />&#160;&#160;&#160; editurl:&#39;jqgrid/ins_claimdetail.php&#39;,<br />&#160;<br />&#160;&#160; ondblClickRow: function(id){&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160; if(id &#38;&#38; id!==lastSel){ <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; jQuery(&#39;#list&#39;).restoreRow(lastSel); <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; lastSel=id; <br />&#160;&#160;&#160;&#160;&#160; } <br />&#160;&#160;&#160;&#160;&#160; jQuery(&#39;#list&#39;).editRow(id, true, pickdates); <br />&#160;&#160; },<br />&#160;&#160; <br />&#160;&#160;&#160; onSelectRow: function(id){ <br />&#160;&#160;&#160;&#160;&#160; if(id &#38;&#38; id!==lastSel){ <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; jQuery(&#39;#list&#39;).restoreRow(lastSel); <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; lastSel=id; <br />&#160;&#160;&#160;&#160;&#160; }&#160; <br />&#160;&#160; },<br />&#160;&#160; <br />/*&#160;&#160;&#160;&#160; afterInsertRow: function(id){ <br />&#160;&#160;&#160;&#160;&#160; if(id &#38;&#38; id!==lastSel){ <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; jQuery(&#39;#list&#39;).saveRow(id,true,&#39;jqgrid/new_claimdetail.php&#39;); <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160; } <br />&#160;&#160; }*/</p>
<p>}); /* end of jqgrid */</p>
<p>jQuery(&#8221;#list&#8221;).jqGrid(&#39;navGrid&#39;,&#39;#pager&#39;,{view:true, del:true, edit:true, search:false}, <br />&#160; {url: &#39;jqgrid/ins_claimdetail.php&#39;}, // use default settings for edit<br />&#160; {url: &#39;jqgrid/new_claimdetail.php&#39;}, // use default settings for add<br />&#160; {url: &#39;jqgrid/del_claimdetail.php&#39;},&#160; // delete instead that del:false we need this<br />&#160; /*{multipleSearch : true}, // enable the advanced searching*/<br />&#160; {closeOnEscape:true} /* allow the view dialog to be closed when user press ESC key*/<br />&#160; ) ; </p>
<p>jQuery(&#8221;#list&#8221;).jqGrid(&#39;navButtonAdd&#39;,&#39;#pager&#39;,{caption:&#8221;New&#8221;, buttonicon :&#39;ui-icon-circle-plus&#39;, <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; onClickButton:function(id){<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; var datarow = {int_claimdetailid:&#8221;&#8221;,txt_item:&#8221;&#8221;,int_claimid:&#8221;&#8221;,dt_date:&#8221;&#8221;,int_reference:&#8221;&#8221;,<br />&#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;cur_amount:&#8221;&#8221;,int_siteid:&#8221;&#8221;,int_accid:&#8221;&#8221;};<br />&#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; var su=jQuery(&#8221;#list&#8221;).addRowData(lastsel2, datarow, &#8220;first&#8221;) ;<br />&#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; jQuery(&#39;#list&#39;).editRow(lastsel2,true, &#39;jqgrid/new_claimdetail.php&#39;); <br />&#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 />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; alert (&#8221;Hi&#8221;); <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; },<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; title:&#8221;New Button&#8221;, /*tooltip for the button*/<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; position:&#8221;last&#8221;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; }); </p>
<p>&#160;<br />&#160;function pickdates(id){ <br />&#160;&#160;&#160;&#160; jQuery(&#8221;#&#8221;+id+&#8221;_dt_date&#8221;,&#8221;#list&#8221;).datepicker({dateFormat:&#8221;yy-mm-dd&#8221;}); } <br />&#160;&#160;&#160; <br />&#160;&#160;&#160; <br />});&#160; /*end of document ready*/</p>
<p>&#60;/script&#62;<br />&#160;</p>
<p>&#60;table id=&#8221;list&#8221;&#62;&#60;/table&#62; <br />&#60;div id=&#8221;pager&#8221;&#62;&#60;/div&#62;</p>
<p> p/s: and hope u could give some thought on the datepicker too!&#160; thanx..</p>
]]></description>
        	        	<pubDate>Fri, 22 Jan 2010 03:24:03 +0200</pubDate>
        </item>
        <item>
        	<title>tony on How to insert a row for inline editing ?</title>
        	<link>http://www.trirand.com/blog/?page_id=393/discussion/how-to-insert-a-row-for-inline-editing#p14026</link>
        	<category>Discussion</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/discussion/how-to-insert-a-row-for-inline-editing#p14026</guid>
        	        	<description><![CDATA[<p>Helllo,</p>
<p>For the first issue use this:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit8014' value='Select Code' data-codeid='sfcode8014' /></p>
<div class='sfcode' id='sfcode8014'>
<p>jQuery(&#39;#list&#39;).editRow(lastsel2,true, &#39;jqgrid/new_claimdetail.php&#39;);</p>
</div>
<p>2. Could not help if no code. Try first to use datepicke without any options</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Tue, 19 Jan 2010 11:09:18 +0200</pubDate>
        </item>
        <item>
        	<title>aznan on How to insert a row for inline editing ?</title>
        	<link>http://www.trirand.com/blog/?page_id=393/discussion/how-to-insert-a-row-for-inline-editing#p13931</link>
        	<category>Discussion</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/discussion/how-to-insert-a-row-for-inline-editing#p13931</guid>
        	        	<description><![CDATA[<p>I try to create a button to do the add new row function by using inline editing..(i think).. but i cant seem to use the enter key watsoeva to send the datas to the db.. plus the datepicker can only accept current date...unless i type it in manually. i dunno how to put/write the url inside the editRow. here my code:</p>
</p>
<p>jQuery("#list").jqGrid(&#39;navButtonAdd&#39;,&#39;#pager&#39;,{caption:"New", buttonicon :&#39;ui-icon-circle-plus&#39;, <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; onClickButton:function(id){<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; var datarow = {int_claimdetailid:"",txt_item:"",int_claimid:"",dt_date:"",int_reference:"",<br />&#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;cur_amount:"",int_siteid:"",int_accid:""};<br />&#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; var su=jQuery("#list").addRowData(lastsel2, datarow, "first") ;<br />&#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; jQuery(&#39;#list&#39;).editRow(lastsel2,true,{url: &#39;jqgrid/new_claimdetail.php&#39;}); <br />&#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 />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; alert ("Hi"); <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; },<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; title:"New Button",<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; position:"last"<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; });</p>
</p>
<p>2. 2nd question.. (will post this under datepicker topic later). I managed to insert the datepicker inside my inline row editing.. but after selecting the date.. how can i set the focus of cursor to the date field so i can use the enter key to send the data... currently i have to do it manually by clicking inside any of the active edited field..</p>
<p>HELLPPP...pleaseeee</p>
<p>tq.. newbie<img class="spSmiley" style="margin:0" title="Cry" src="/blog/wp-content/forum-smileys/sf-cry.gif" alt="Cry" /></p>
]]></description>
        	        	<pubDate>Fri, 15 Jan 2010 10:54:13 +0200</pubDate>
        </item>
        <item>
        	<title>tony on How to insert a row for inline editing ?</title>
        	<link>http://www.trirand.com/blog/?page_id=393/discussion/how-to-insert-a-row-for-inline-editing#p12572</link>
        	<category>Discussion</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/discussion/how-to-insert-a-row-for-inline-editing#p12572</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Use addRowData and edit that row with editRow.</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Mon, 30 Nov 2009 12:30:51 +0200</pubDate>
        </item>
        <item>
        	<title>cakebunny on How to insert a row for inline editing ?</title>
        	<link>http://www.trirand.com/blog/?page_id=393/discussion/how-to-insert-a-row-for-inline-editing#p12567</link>
        	<category>Discussion</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/discussion/how-to-insert-a-row-for-inline-editing#p12567</guid>
        	        	<description><![CDATA[<p>My grid is too long , it needs to scroll to see the full fields , so I don&#39;t want to use a popup to let the user fill in the data.</p>
<p>Instead I want to insert a row ,and then for an inline editing .</p>
<p>Is there anyone can give me some ideas ? Thanks.</p>
]]></description>
        	        	<pubDate>Mon, 30 Nov 2009 10:43:46 +0200</pubDate>
        </item>
</channel>
</rss>