<?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: small bug in generating new id in postIt() of editGridRow()</title>
	<link>http://www.trirand.com/blog/?page_id=393/bugs/small-bug-in-generating-new-id-in-postit-of-editgridrow</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/bugs/small-bug-in-generating-new-id-in-postit-of-editgridrow/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>OlegK on small bug in generating new id in postIt() of editGridRow()</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/small-bug-in-generating-new-id-in-postit-of-editgridrow#p22395</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/small-bug-in-generating-new-id-in-postit-of-editgridrow#p22395</guid>
        	        	<description><![CDATA[<p>You are welcome!</p>
<p>The only problem is to post code in the forum. Currently I have to make replacement of all blanks to <strong>&#38;nbsp;</strong> and append every line with &#60;br /&#62; to make code looks OK in the forum. I have to do the changes in another text editor and post the code in the HTML view. Probably you know some tricks.</p>
<p>Oleg</p>
]]></description>
        	        	<pubDate>Sun, 13 Mar 2011 12:42:43 +0200</pubDate>
        </item>
        <item>
        	<title>tony on small bug in generating new id in postIt() of editGridRow()</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/small-bug-in-generating-new-id-in-postit-of-editgridrow#p22394</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/small-bug-in-generating-new-id-in-postit-of-editgridrow#p22394</guid>
        	        	<description><![CDATA[<p>Oleg,</p>
<p>Sorry, I think it was in separate post</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Sun, 13 Mar 2011 12:20:53 +0200</pubDate>
        </item>
        <item>
        	<title>OlegK on small bug in generating new id in postIt() of editGridRow()</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/small-bug-in-generating-new-id-in-postit-of-editgridrow#p22393</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/small-bug-in-generating-new-id-in-postit-of-editgridrow#p22393</guid>
        	        	<description><![CDATA[<p class="MsoNormal"><span class="SpellE">No</span> <span class="SpellE">problem</span> Tony!</p>
<p class="MsoNormal" style="background-image:initial;background-attachment:initial; background-origin: initial;background-clip: initial;background-position:initial initial; background-repeat:initial initial"><span class="SpellE">It</span> <span class="SpellE">is</span> <a href="http://www.ok-soft-gmbh.com/jqGrid/LocalFormEditing.htm" rel="nofollow" target="_blank"><a href="http://www.ok-soft-gmbh.com/jq" rel="nofollow">http://www.ok-soft-gmbh.com/jq</a>.....diting.htm</a>. <span class="SpellE">It</span> <span class="SpellE">is</span> in <span class="SpellE">the</span> last <span class="SpellE">paragraph</span> <span class="SpellE">of</span> <span class="SpellE">my</span> <span class="SpellE">first</span> <span class="SpellE">post</span> in <a href="/blog/?page_id=393/bugs/small-bug-in-generating-new-id-in-postit-of-editgridrow/#p22328" target="_blank"><span class="SpellE">the</span> <span class="SpellE">tread</span></a>.</p>
<p class="MsoNormal">Best <span class="SpellE">regards</span><br /> Oleg</p>
<p class="MsoNormal">P.S. I tried meny time to post the whole code also here. It is terrible!</p>
<p><input type='button' class='sfcodeselect' name='sfselectit8880' value='Select Code' data-codeid='sfcode8880' /></p>
<div class='sfcode' id='sfcode8880'>var&#160;lastSel,&#160;mydata&#160;=&#160;[<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{id:&#34;1&#34;,invdate:&#34;2007-10-01&#34;,name:&#34;test&#34;,note:&#34;note&#34;,amount:&#34;200.00&#34;,tax:&#34;10.00&#34;,<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;closed:true,&#160;ship_via:&#34;TN&#34;,total:&#34;210.00&#34;},<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{id:&#34;2&#34;,invdate:&#34;2007-10-02&#34;,name:&#34;test2&#34;,note:&#34;note2&#34;,amount:&#34;300.00&#34;,tax:&#34;20.00&#34;,<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;closed:false,ship_via:&#34;FE&#34;,total:&#34;320.00&#34;},<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{id:&#34;3&#34;,invdate:&#34;2007-09-01&#34;,name:&#34;test3&#34;,note:&#34;note3&#34;,amount:&#34;400.00&#34;,tax:&#34;30.00&#34;,<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;closed:false,ship_via:&#34;FE&#34;,total:&#34;430.00&#34;},<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{id:&#34;4&#34;,invdate:&#34;2007-10-04&#34;,name:&#34;test4&#34;,note:&#34;note4&#34;,amount:&#34;200.00&#34;,tax:&#34;10.00&#34;,<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;closed:true,ship_via:&#34;TN&#34;,total:&#34;210.00&#34;},<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{id:&#34;5&#34;,invdate:&#34;2007-10-31&#34;,name:&#34;test5&#34;,note:&#34;note5&#34;,amount:&#34;300.00&#34;,tax:&#34;20.00&#34;,<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;closed:false,ship_via:&#34;FE&#34;,total:&#34;320.00&#34;},<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{id:&#34;6&#34;,invdate:&#34;2007-09-06&#34;,name:&#34;test6&#34;,note:&#34;note6&#34;,amount:&#34;400.00&#34;,tax:&#34;30.00&#34;,<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;closed:false,ship_via:&#34;FE&#34;,total:&#34;430.00&#34;},<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{id:&#34;7&#34;,invdate:&#34;2007-10-04&#34;,name:&#34;test7&#34;,note:&#34;note7&#34;,amount:&#34;200.00&#34;,tax:&#34;10.00&#34;,<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;closed:true&#160;,ship_via:&#34;TN&#34;,total:&#34;210.00&#34;},<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{id:&#34;8&#34;,invdate:&#34;2007-10-03&#34;,name:&#34;test8&#34;,note:&#34;note8&#34;,amount:&#34;300.00&#34;,tax:&#34;20.00&#34;,<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;closed:false,ship_via:&#34;FE&#34;,total:&#34;320.00&#34;},<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{id:&#34;9&#34;,invdate:&#34;2007-09-01&#34;,name:&#34;test9&#34;,note:&#34;note9&#34;,amount:&#34;400.00&#34;,tax:&#34;30.00&#34;,<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;closed:false,ship_via:&#34;TN&#34;,total:&#34;430.00&#34;},<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{id:&#34;10&#34;,invdate:&#34;2007-09-08&#34;,name:&#34;test10&#34;,note:&#34;note10&#34;,amount:&#34;500.00&#34;,<br />&#160;&#160; &#160; &#160; &#160; tax:&#34;30.00&#34;,closed:true&#160;,ship_via:&#34;TN&#34;,total:&#34;530.00&#34;},<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{id:&#34;11&#34;,invdate:&#34;2007-09-08&#34;,name:&#34;test11&#34;,note:&#34;note11&#34;,amount:&#34;500.00&#34;,<br />&#160;&#160; &#160; &#160; &#160; tax:&#34;30.00&#34;,closed:false,ship_via:&#34;FE&#34;,total:&#34;530.00&#34;},<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{id:&#34;12&#34;,invdate:&#34;2007-09-10&#34;,name:&#34;test12&#34;,note:&#34;note12&#34;,amount:&#34;500.00&#34;,<br />&#160;&#160; &#160; &#160; &#160; tax:&#34;30.00&#34;,closed:false,ship_via:&#34;FE&#34;,total:&#34;530.00&#34;}<br /> &#160;&#160;&#160;&#160;],<br /> &#160;&#160;&#160;&#160;grid&#160;=&#160;$(&#34;#list&#34;),<br /> &#160;&#160;&#160;&#160;onclickSubmitLocal&#160;=&#160;function(options,postdata)&#160;{<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;var&#160;grid_p&#160;=&#160;grid[0].p,<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;idname&#160;=&#160;grid_p.prmNames.id,<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;grid_id&#160;=&#160;grid[0].id,<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;id_in_postdata&#160;=&#160;grid_id+&#34;_id&#34;,<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;rowid&#160;=&#160;postdata[id_in_postdata],<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;addMode&#160;=&#160;rowid&#160;===&#160;&#34;_empty&#34;,<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;oldValueOfSortColumn;</p>
<p> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;//&#160;postdata&#160;has&#160;row&#160;id&#160;property&#160;with&#160;another&#160;name.&#160;we&#160;fix&#160;it:<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if&#160;(addMode)&#160;{<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;//&#160;generate&#160;new&#160;id<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;var&#160;new_id&#160;=&#160;grid_p.records&#160;+&#160;1;<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;while&#160;($(&#34;#&#34;+new_id).length&#160;!==&#160;0)&#160;{<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;new_id++;<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;postdata[idname]&#160;=&#160;String(new_id);<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}&#160;else&#160;if&#160;(typeof(postdata[idname])&#160;===&#160;&#34;undefined&#34;)&#160;{<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;//&#160;set&#160;id&#160;property&#160;only&#160;if&#160;the&#160;property&#160;not&#160;exist<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;postdata[idname]&#160;=&#160;rowid;<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;delete&#160;postdata[id_in_postdata];</p>
<p> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;//&#160;prepare&#160;postdata&#160;for&#160;tree&#160;grid<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if(grid_p.treeGrid&#160;===&#160;true)&#160;{<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if(addMode)&#160;{<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;var&#160;tr_par_id&#160;=&#160;grid_p.treeGridModel&#160;===&#160;&#39;adjacency&#39;&#160;?&#160;grid_p.treeReader.parent_id_field&#160;:&#160;&#39;parent_id&#39;;<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;postdata[tr_par_id]&#160;=&#160;grid_p.selrow;<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}</p>
<p> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;$.each(grid_p.treeReader,&#160;function&#160;(i){<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if(postdata.hasOwnProperty(this))&#160;{<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;delete&#160;postdata[this];<br /> &#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;});<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}</p>
<p> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;//&#160;decode&#160;data&#160;if&#160;there&#160;encoded&#160;with&#160;autoencode<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if(grid_p.autoencode)&#160;{<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;$.each(postdata,function(n,v){<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;postdata[n]&#160;=&#160;$.jgrid.htmlDecode(v);&#160;//&#160;TODO:&#160;some&#160;columns&#160;could&#160;be&#160;skipped<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;});<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}</p>
<p> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;//&#160;save&#160;old&#160;value&#160;from&#160;the&#160;sorted&#160;column<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;oldValueOfSortColumn&#160;=&#160;grid_p.sortname&#160;===&#160;&#34;&#34;&#160;?&#160;undefined:&#160;grid.jqGrid(&#39;getCell&#39;,rowid,grid_p.sortname);</p>
<p> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;//&#160;save&#160;the&#160;data&#160;in&#160;the&#160;grid<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if&#160;(grid_p.treeGrid&#160;===&#160;true)&#160;{<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if&#160;(addMode)&#160;{<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;grid.jqGrid(&#34;addChildNode&#34;,rowid,grid_p.selrow,postdata);<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}&#160;else&#160;{<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;grid.jqGrid(&#34;setTreeRow&#34;,rowid,postdata);<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}&#160;else&#160;{<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if&#160;(addMode)&#160;{<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;grid.jqGrid(&#34;addRowData&#34;,rowid,postdata,options.addedrow);<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}&#160;else&#160;{<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;grid.jqGrid(&#34;setRowData&#34;,rowid,postdata);<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}</p>
<p> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if&#160;((addMode&#160;&#38;&#38;&#160;options.closeAfterAdd)&#160;&#124;&#124;&#160;(!addMode&#160;&#38;&#38;&#160;options.closeAfterEdit))&#160;{<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;//&#160;close&#160;the&#160;edit/add&#160;dialog<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;$.jgrid.hideModal(&#34;#editmod&#34;+grid_id,<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;&#160;&#160;{gb:&#34;#gbox_&#34;+grid_id,jqm:options.jqModal,onClose:options.onClose});<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}</p>
<p> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if&#160;(postdata[grid_p.sortname]&#160;!==&#160;oldValueOfSortColumn)&#160;{<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;//&#160;if&#160;the&#160;data&#160;are&#160;changed&#160;in&#160;the&#160;column&#160;by&#160;which&#160;are&#160;currently&#160;sorted<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;//&#160;we&#160;need&#160;resort&#160;the&#160;grid<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;setTimeout(function()&#160;{<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;grid.trigger(&#34;reloadGrid&#34;,&#160;[{current:true}]);<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;},100);<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}</p>
<p> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;//&#160;!!!&#160;the&#160;most&#160;important&#160;step:&#160;skip&#160;ajax&#160;request&#160;to&#160;the&#160;server<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;this.processing&#160;=&#160;true;<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;return&#160;{};<br /> &#160;&#160;&#160;&#160;},<br /> &#160;&#160;&#160;&#160;editSettings&#160;=&#160;{<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;recreateForm:true,<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;jqModal:false,<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;reloadAfterSubmit:false,<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;closeOnEscape:true,<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;closeAfterEdit:true,<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;onclickSubmit:onclickSubmitLocal<br /> &#160;&#160;&#160;&#160;},<br /> &#160;&#160;&#160;&#160;addSettings&#160;=&#160;{<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;recreateForm:true,<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;jqModal:false,<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;reloadAfterSubmit:false,<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;closeOnEscape:true,<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;closeAfterAdd:true,<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;onclickSubmit:onclickSubmitLocal<br /> &#160;&#160;&#160;&#160;},<br /> &#160;&#160;&#160;&#160;delSettings&#160;=&#160;{<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;//&#160;because&#160;I&#160;use&#160;&#34;local&#34;&#160;data&#160;I&#160;don&#39;t&#160;want&#160;to&#160;send&#160;the&#160;changes&#160;to&#160;the&#160;server<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;//&#160;so&#160;I&#160;use&#160;&#34;processing:true&#34;&#160;setting&#160;and&#160;delete&#160;the&#160;row&#160;manually&#160;in&#160;onclickSubmit<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;onclickSubmit:&#160;function(options,&#160;rowid)&#160;{<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;var&#160;grid_id&#160;=&#160;grid[0].id,<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;grid_p&#160;=&#160;grid[0].p,<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;newPage&#160;=&#160;grid[0].p.page;</p>
<p> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;//&#160;delete&#160;the&#160;row<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;grid.delRowData(rowid);<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;$.jgrid.hideModal(&#34;#delmod&#34;+grid_id,<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;&#160;&#160;{gb:&#34;#gbox_&#34;+grid_id,jqm:options.jqModal,onClose:options.onClose});</p>
<p> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if&#160;(grid_p.lastpage&#160;&#62;&#160;1)&#160;{//&#160;on&#160;the&#160;multipage&#160;grid&#160;reload&#160;the&#160;grid<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if&#160;(grid_p.reccount&#160;===&#160;0&#160;&#38;&#38;&#160;newPage&#160;===&#160;grid_p.lastpage)&#160;{<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;//&#160;if&#160;after&#160;deliting&#160;there&#160;are&#160;no&#160;rows&#160;on&#160;the&#160;current&#160;page<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;//&#160;which&#160;is&#160;the&#160;last&#160;page&#160;of&#160;the&#160;grid<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;newPage--;&#160;//&#160;go&#160;to&#160;the&#160;previous&#160;page<br /> &#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;reload&#160;grid&#160;to&#160;make&#160;the&#160;row&#160;from&#160;the&#160;next&#160;page&#160;visable.<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;grid.trigger(&#34;reloadGrid&#34;,&#160;[{page:newPage}]);<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}</p>
<p> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;return&#160;true;<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;},<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;processing:true<br /> &#160;&#160;&#160;&#160;},<br /> &#160;&#160;&#160;&#160;initDateEdit&#160;=&#160;function(elem)&#160;{<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;setTimeout(function()&#160;{<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;$(elem).datepicker({<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;dateFormat:&#160;&#39;dd-M-yy&#39;,<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;autoSize:&#160;true,<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;showOn:&#160;&#39;button&#39;,&#160;//&#160;it&#160;dosn&#39;t&#160;work&#160;in&#160;searching&#160;dialog<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;changeYear:&#160;true,<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;changeMonth:&#160;true,<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;showButtonPanel:&#160;true,<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;showWeek:&#160;true<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;//$(elem).focus();<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;},100);<br /> &#160;&#160;&#160;&#160;},<br /> &#160;&#160;&#160;&#160;initDateSearch&#160;=&#160;function(elem)&#160;{<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;setTimeout(function()&#160;{<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;$(elem).datepicker({<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;dateFormat:&#160;&#39;dd-M-yy&#39;,<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;autoSize:&#160;true,<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;//showOn:&#160;&#39;button&#39;,&#160;//&#160;it&#160;dosn&#39;t&#160;work&#160;in&#160;searching&#160;dialog<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;changeYear:&#160;true,<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;changeMonth:&#160;true,<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;showButtonPanel:&#160;true,<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;showWeek:&#160;true<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;//$(elem).focus();<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;},100);<br /> &#160;&#160;&#160;&#160;};</p>
<p> grid.jqGrid({<br /> &#160;&#160;&#160;&#160;datatype:&#39;local&#39;,<br /> &#160;&#160;&#160;&#160;data:&#160;mydata,<br /> &#160;&#160;&#160;&#160;colNames:[&#39;Inv&#160;No&#39;,&#39;Date&#39;,&#39;Client&#39;,&#39;Amount&#39;,&#39;Tax&#39;,&#39;Total&#39;,&#39;Closed&#39;,&#39;Shipped&#160;via&#39;,&#39;Notes&#39;],<br /> &#160;&#160;&#160;&#160;colModel:[<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{name:&#39;id&#39;,index:&#39;id&#39;,width:70,align:&#39;center&#39;,sorttype:&#160;&#39;int&#39;,searchoptions:{sopt:[&#39;eq&#39;,&#39;ne&#39;]}},<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{name:&#39;invdate&#39;,index:&#39;invdate&#39;,width:80,&#160;align:&#39;center&#39;,&#160;sorttype:&#39;date&#39;,<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;formatter:&#39;date&#39;, datefmt:&#160;&#39;d-M-Y&#39;,<br />&#160;&#160; &#160; &#160; &#160; &#160; &#160;formatoptions:&#160;{newformat:&#39;d-M-Y&#39;},&#160;editable:true,&#160;<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;editoptions:&#160;{dataInit:initDateEdit},<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;searchoptions:&#160;{dataInit:initDateSearch}},<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{name:&#39;name&#39;,index:&#39;name&#39;,editable:&#160;true,&#160;width:70,&#160;editrules:{required:true}},<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{name:&#39;amount&#39;,index:&#39;amount&#39;,width:100,formatter:&#39;number&#39;,editable:true,align:&#39;right&#39;},<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{name:&#39;tax&#39;,index:&#39;tax&#39;,width:70,&#160;formatter:&#39;number&#39;,&#160;editable:&#160;true,&#160;align:&#39;right&#39;},<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{name:&#39;total&#39;,index:&#39;total&#39;,width:120,&#160;formatter:&#39;number&#39;,&#160;editable:&#160;true,&#160;align:&#39;right&#39;},<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{name:&#39;closed&#39;,index:&#39;closed&#39;,width:110,align:&#39;center&#39;,editable:&#160;true,<br />&#160;&#160; &#160; &#160; &#160; &#160; &#160;formatter:&#160;&#39;checkbox&#39;,<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;edittype:&#39;checkbox&#39;,editoptions:{value:&#39;Yes:No&#39;,defaultValue:&#39;Yes&#39;},<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;stype:&#160;&#39;select&#39;,<br />&#160;&#160; &#160; &#160; &#160; &#160; &#160;searchoptions:&#160;{&#160;sopt:[&#39;eq&#39;,&#39;ne&#39;],&#160;value:&#39;:All;true:Yes;false:No&#39;&#160;}},<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{name:&#39;ship_via&#39;,index:&#39;ship_via&#39;,width:120,align:&#39;center&#39;,editable:&#160;true,&#160;formatter:&#39;select&#39;,<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;edittype:&#39;select&#39;,editoptions:value:&#39;FE:FedEx;TN:TNT;IN:Intim&#39;,defaultValue:&#39;Intime&#39;},<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;stype:&#39;select&#39;,&#160;searchoptions:{value:&#39;:All;FE:FedEx;TN:TNT;IN:Intim&#39;}},<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{name:&#39;note&#39;,index:&#39;note&#39;,width:100,sortable:false,editable:true,edittype:&#39;textarea&#39;}<br /> &#160;&#160;&#160;&#160;],<br /> &#160;&#160;&#160;&#160;rowNum:10,<br /> &#160;&#160;&#160;&#160;rowList:[5,10,20],<br /> &#160;&#160;&#160;&#160;pager:&#160;&#39;#pager&#39;,<br /> &#160;&#160;&#160;&#160;gridview:true,<br /> &#160;&#160;&#160;&#160;rownumbers:true,<br /> &#160;&#160;&#160;&#160;autoencode:true,<br /> &#160;&#160;&#160;&#160;ignoreCase:true,<br /> &#160;&#160;&#160;&#160;sortname:&#160;&#39;invdate&#39;,<br /> &#160;&#160;&#160;&#160;viewrecords:&#160;true,<br /> &#160;&#160;&#160;&#160;sortorder:&#160;&#39;desc&#39;,<br /> &#160;&#160;&#160;&#160;caption:&#39;How&#160;to&#160;implement&#160;local&#160;form&#160;editing&#39;,<br /> &#160;&#160;&#160;&#160;height:&#160;&#39;100%&#39;,<br /> &#160;&#160;&#160;&#160;editurl:&#160;&#39;clientArray&#39;,<br /> &#160;&#160;&#160;&#160;ondblClickRow:&#160;function(rowid,&#160;ri,&#160;ci)&#160;{<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;var&#160;p&#160;=&#160;grid[0].p;<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if&#160;(p.selrow&#160;!==&#160;rowid)&#160;{<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;//&#160;prevent&#160;the&#160;row&#160;from&#160;be&#160;unselected&#160;on&#160;double-click<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;//&#160;the&#160;implementation&#160;is&#160;for&#160;&#34;multiselect:false&#34;&#160;which&#160;we&#160;use,<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;//&#160;but&#160;one&#160;can&#160;easy&#160;modify&#160;the&#160;code&#160;for&#160;&#34;multiselect:true&#34;<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;grid.jqGrid(&#39;setSelection&#39;,&#160;rowid);<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;grid.jqGrid(&#39;editGridRow&#39;,&#160;rowid,&#160;editSettings);<br /> &#160;&#160;&#160;&#160;},<br /> &#160;&#160;&#160;&#160;onSelectRow:&#160;function(id)&#160;{<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if&#160;(id&#160;&#38;&#38;&#160;id&#160;!==&#160;lastSel)&#160;{<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;//&#160;cancel&#160;editing&#160;of&#160;the&#160;previous&#160;selected&#160;row&#160;if&#160;it&#160;was&#160;in&#160;editing&#160;state.<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;//&#160;jqGrid&#160;hold&#160;intern&#160;savedRow&#160;array&#160;inside&#160;of&#160;jqGrid&#160;object,<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;//&#160;so&#160;it&#160;is&#160;safe&#160;to&#160;call&#160;restoreRow&#160;method&#160;with&#160;any&#160;id&#160;parameter<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;//&#160;if&#160;jqGrid&#160;not&#160;in&#160;editing&#160;state<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if&#160;(typeof&#160;lastSel&#160;!==&#160;&#34;undefined&#34;)&#160;{<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;grid.jqGrid(&#39;restoreRow&#39;,lastSel);<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;lastSel&#160;=&#160;id;<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}<br /> &#160;&#160;&#160;&#160;}<br /> }).jqGrid(&#39;navGrid&#39;,&#39;#pager&#39;,{},editSettings,addSettings,delSettings,<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{multipleSearch:true,overlay:false,<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;onClose:function(form){<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;//&#160;if&#160;we&#160;close&#160;the&#160;search&#160;dialog&#160;during&#160;the&#160;datapicker&#160;are&#160;opened<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;//&#160;the&#160;datepicker&#160;will&#160;stay&#160;opened.&#160;To&#160;fix&#160;this&#160;we&#160;have&#160;to&#160;hide<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;//&#160;the&#160;div&#160;used&#160;by&#160;datepicker<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;$(&#34;div#ui-datepicker-div.ui-datepicker&#34;).hide();<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}});</p>
</div>
]]></description>
        	        	<pubDate>Sun, 13 Mar 2011 11:58:46 +0200</pubDate>
        </item>
        <item>
        	<title>tony on small bug in generating new id in postIt() of editGridRow()</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/small-bug-in-generating-new-id-in-postit-of-editgridrow#p22392</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/small-bug-in-generating-new-id-in-postit-of-editgridrow#p22392</guid>
        	        	<description><![CDATA[<p>Hello Oleg,</p>
<p>Sorry, but I can not find the link you provided for the local form editing.</p>
<p>Could you please post it again?</p>
<p>Thank you.</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Sun, 13 Mar 2011 10:24:45 +0200</pubDate>
        </item>
        <item>
        	<title>tony on small bug in generating new id in postIt() of editGridRow()</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/small-bug-in-generating-new-id-in-postit-of-editgridrow#p22383</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/small-bug-in-generating-new-id-in-postit-of-editgridrow#p22383</guid>
        	        	<description><![CDATA[<p>Well,</p>
<p>Yes there is a possibility to have duplicates, but I think I found the uniquie approach</p>
<p><input type='button' class='sfcodeselect' name='sfselectit2966' value='Select Code' data-codeid='sfcode2966' /></p>
<div class='sfcode' id='sfcode2966'>
<p>randId : function ()</p>
<p>{</p>
<p>return String(new Date().getTime());</p>
<p>}</p>
</div>
<p><img class="spSmiley" style="margin:0" title="Confused" src="/blog/wp-content/forum-smileys/sf-confused.gif" alt="Confused" /></p>
<p>I will look right now deeper into your code for the local form editing.</p>
<p>Regards</p>
]]></description>
        	        	<pubDate>Sat, 12 Mar 2011 12:24:14 +0200</pubDate>
        </item>
        <item>
        	<title>OlegK on small bug in generating new id in postIt() of editGridRow()</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/small-bug-in-generating-new-id-in-postit-of-editgridrow#p22382</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/small-bug-in-generating-new-id-in-postit-of-editgridrow#p22382</guid>
        	        	<description><![CDATA[<p>Hello Tony,</p>
<p>the usage of <strong>randId</strong> I like also more, but to be consequent one can also use the same function in grid.base.js, for example <a href="https://github.com/tonytomov/jqGrid/blob/master/js/grid.base.js#L1233" target="_blank">here</a>. One can have small compatibility problem if somebody play on the interger sequential id numbers if he don&#39;t define any id (or define in the wrong way) in the input data.</p>
<p>One thing I would do: one should verify that the id genrated with respect of <strong>Math.random</strong> are not yet used. All standard random function are not so random, only random function from the cryptographical modules can produce good rendom numbers. See <a href="http://stackoverflow.com/questions/1062902/how-random-is-javascripts-math-random/1062948#1062948" target="_blank">this answer</a> for example. A simple verification like <strong>$("#"+new_id).length !== 0</strong> will be enough.</p>
<p>I recommed you additionally use <strong>Math.floor(Math.random()*idMax<span style="text-decoration: underline;">+1</span>)</strong> instead of <strong>Math.floor(Math.random()*</strong><strong>idMax</strong><strong>)</strong> which you currently use. It will no more produce id=0 which can be not the best in different JavaScript compares. The <strong>idMax</strong> value can be jqGrid parameter initialized to 10000.</p>
<p>What do you think about including supports for local editing in the form editing module? Do you want to implement it youself or I can write an suggestion (till now I didn&#39;t find time to do this, but next week I could do this).</p>
<p>Best regards<br />Oleg</p>
]]></description>
        	        	<pubDate>Sat, 12 Mar 2011 11:49:22 +0200</pubDate>
        </item>
        <item>
        	<title>tony on small bug in generating new id in postIt() of editGridRow()</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/small-bug-in-generating-new-id-in-postit-of-editgridrow#p22381</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/small-bug-in-generating-new-id-in-postit-of-editgridrow#p22381</guid>
        	        	<description><![CDATA[<p>Oleg,</p>
<p>Yes this is true and is a problem.</p>
<p>This one is good solution, but I think a better way is to use a random function to generate the id - something like in the new filter module.</p>
<p>I will use this approach.</p>
</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Sat, 12 Mar 2011 11:22:55 +0200</pubDate>
        </item>
        <item>
        	<title>OlegK on small bug in generating new id in postIt() of editGridRow()</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/small-bug-in-generating-new-id-in-postit-of-editgridrow#p22328</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/small-bug-in-generating-new-id-in-postit-of-editgridrow#p22328</guid>
        	        	<description><![CDATA[<p>Hello Tony,</p>
<p>in some seldom situation the <strong>postIt()</strong> of <strong>editGridRow()</strong> generate new row id with the following <a href="https://github.com/tonytomov/jqGrid/blob/master/js/grid.formedit.js#L637" target="_blank">line</a> of code</p>
<p><input type='button' class='sfcodeselect' name='sfselectit8785' value='Select Code' data-codeid='sfcode8785' /></p>
<div class='sfcode' id='sfcode8785'>if(!ret[2]) { ret[2] = (parseInt($t.p.records,10)+1)+&#34;&#34;; }</div>
<p>which is not quite correct.</p>
<p>1) <strong>$t.p.records</strong> is already a Number and one don&#39;t need to make <strong>parseInt($t.p.records,10)</strong></p>
<p>2) if one add the row after deliting some previously added lines with the small id number, one can receive id duplication&#160;in case of the usage the code&#160;<strong>ret[2] = $t.p.records+"";</strong></p>
<p>So I suggest to fix in so way</p>
<p><input type='button' class='sfcodeselect' name='sfselectit8906' value='Select Code' data-codeid='sfcode8906' /></p>
<div class='sfcode' id='sfcode8906'>if(!ret[2]) {<br />&#160;&#160; &#160;// generate new id<br />&#160;&#160; &#160;var new_id = $t.p.records + 1;<br />&#160;&#160; &#160;// If one remove some rows before insterting the row it can be that<br />&#160;&#160; &#160;// id = $t.p.records + 1 is already in use. So we have to find<br />&#160;&#160; &#160;// another unused id<br />&#160;&#160; &#160;while ($(&#34;#&#34;+new_id).length !== 0) { // verify that the id already exist<br />&#160;&#160; &#160; &#160; &#160;new_id++;<br />&#160;&#160; &#160;}<br />&#160;&#160; &#160;ret[2] = String(new_id);<br /> }</div>
<p>By the way the current version of the form editing not supports local editing. I made <a href="http://www.ok-soft-gmbh.com/jqGrid/LocalFormEditing.htm" target="_blank">the example</a> which shows how one can do use local editing&#160;with respecrt of form editing. Based on the example I will try to write the corresponding suggestiond to change <strong>grid.formedit.js</strong> to allow local editing. I will post the corresponding new code of the <strong>postIt()</strong>&#160;in the next time in "Feature Requests".</p>
<p>Best regards<br />Oleg</p>
]]></description>
        	        	<pubDate>Mon, 07 Mar 2011 12:22:24 +0200</pubDate>
        </item>
</channel>
</rss>