<?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: using beforeShowForm</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/using-beforeshowform</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/using-beforeshowform/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>Reg on using beforeShowForm</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/using-beforeshowform#p18803</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/using-beforeshowform#p18803</guid>
        	        	<description><![CDATA[<p>I am using version 3.7; my code used to work in version 3.4 and I cannot figure out what has changed to make it not work now.</p>
<p>THe problem is in Form Editing; when the form to add a record&#160;is created I use beforeShowForm to set default values on the fields. I have an alert in the beforeShowForm event so I know it is firing, but none of the default values are set correctly when the form appears.</p>
<p>So either the commands I use are no longer the right ones, or something is changing them afterwards. A snippet from my code shows here:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit931' value='Select Code' data-codeid='sfcode931' /></p>
<div class='sfcode' id='sfcode931'>
<p>&#160;&#160;&#160; beforeShowForm : function (formid) { <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; alert(&#34;in beforeShowForm&#34;) ; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $(&#34;#effective&#34;,formid).val(&#34;2010/07/24&#34;);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $(&#34;#status&#34;,formid).val(&#34;Active&#34;);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $(&#34;#transaction&#34;,formid).val(&#34;Salary Change&#34;);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $(&#34;#reason&#34;,formid).val(&#34;&#34;);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $(&#34;#position&#34;,formid).val(&#34;Vice President&#34;);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $(&#34;#empgroup&#34;,formid).val(&#34;Professional&#34;);<br />&#160;</p>
</div>
<p>Anyone see what I am doing wrong?</p>
<p>Thanks</p>
<p>Reg</p>
</p>
<p>Later... One of the benefits of turning your problem over to someone else to consider and suggest fixes for is that it relieves the stress and frees&#160;your mind to figure out the problem for yourself. The disadvantage is that now your inability to grasp the concepts is made embarrassingly public.</p>
<p>I now relaize (I think I am correct) that this is probably part of the new api issue, but I am unable to find anything specifically related to setting the value of a form field like this in the discussion (or examples) of the new api.</p>
<p>Has anyone figured this out? Can anyone provide an example of the correct syntax?</p>
<p>THanks</p>
<p>Reg</p>
]]></description>
        	        	<pubDate>Sat, 24 Jul 2010 18:07:42 +0300</pubDate>
        </item>
</channel>
</rss>