<?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: Adding datas</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/adding-datas</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/adding-datas/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tony on Adding datas</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/adding-datas#p15274</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/adding-datas#p15274</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>IMHO this is not jqGrid problem. We have a wide range of events to do what you want,&#160; but we do not have a solutions on how you will check if the record exists in the database.</p>
<p>Instead maybe you will use ajax in <strong>mycheck</strong> function to determine if the record exists in the DB. The more important part here is that you need to use ajax with async option set to false.</p>
<p>Best Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Mon, 01 Mar 2010 21:13:11 +0200</pubDate>
        </item>
        <item>
        	<title>JiheL on Adding datas</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/adding-datas#p15177</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/adding-datas#p15177</guid>
        	        	<description><![CDATA[</p>
<p>Hello Tony,</p>
<p>First of all, thanks for your help about CSS trouble with modal dialog box, I hope you can solve it soon.</p>
<p>Now I&#39;m going further and try to add some datas in my database with add modal box.</p>
<p>I saved my datas and that&#39;s fine.</p>
<p>My question is about how to validate datas before updating db :</p>
<p>[Image Can Not Be Found]</p>
<p>I would like to test if the &#39;code client&#39; filled &#39;44a&#39; already exists in the db, in this case, adding datas cannot be performed and user have to be informed, otherwise I would like to populate &#39;raison sociale&#39;,&#39;site&#39; in the row with extracted datas from db, and put &#39;code client&#39; value in uppercase.</p>
<p>Here is my code for this field :</p>
<p><input type='button' class='sfcodeselect' name='sfselectit3171' value='Select Code' data-codeid='sfcode3171' /></p>
<div class='sfcode' id='sfcode3171'>{name:&#39;code&#39;,index:&#39;code&#39;, width:30, sortable:true,<br />&#160; editable:true,<br />&#160; edittype:&#34;text&#34;,<br />&#160; editoptions:{<br />&#160;&#160;&#160; readonly:false,size:5,maxlength:5<br />&#160; },<br />&#160; formoptions:{<br />&#160;&#160;&#160; label:&#34;Code client&#34;, elmprefix:&#34;&#60;font color=&#39;red&#39;&#62;&#38;nbsp;*&#38;nbsp;&#60;/font&#62;&#34;<br />&#160; },<br />&#160; editrules:{required:true,custom:true,custom_func:mycheck}<br />}</div>
<p>and the test function :</p>
<p><input type='button' class='sfcodeselect' name='sfselectit7690' value='Select Code' data-codeid='sfcode7690' /></p>
<div class='sfcode' id='sfcode7690'>function mycheck(value,colname) { <br />&#160; switch(colname){<br />&#160;&#160;&#160; case &#34;Code client&#34;:<br />&#160;&#160;&#160;&#160;&#160; if(value &#62; &#34;&#34;) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $(&#34;#code&#34;).val()=value.toUpperCase();<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; return [true,&#34;OK&#34;,&#34;&#34;]; <br />&#160;&#160;&#160;&#160;&#160; } <br />&#160;&#160;&#160;&#160;&#160; break;<br />&#160;&#160;&#160; default:<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; return [false,&#34;Code CLIENT erron&#233;&#34;,&#34;&#34;];<br />&#160; }<br />}
</div>
<p>I think that I have to put some code in this function for accessing db and extract fields values, but I don&#39;t know how to address row cols with these values.</p>
<p>And the last point, how to avoid to have added row when &#39;code clt&#39; already exists in database ?</p>
<p>I have read many chapters in wiki without finding any way to progress. Sorry to disturb you in your great job.</p>
<p>I hope you will give me some way to continue.</p>
<p>Have a nice day and a good we.</p>
<p>Best regards</p>
<p>Jihel</p>
]]></description>
        	        	<pubDate>Fri, 26 Feb 2010 12:53:48 +0200</pubDate>
        </item>
</channel>
</rss>