<?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: Form Edit: Setting the focus to a field</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/form-edit-setting-the-focus-to-a-field</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/form-edit-setting-the-focus-to-a-field/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>carlos.vita on Form Edit: Setting the focus to a field</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/form-edit-setting-the-focus-to-a-field#p15713</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/form-edit-setting-the-focus-to-a-field#p15713</guid>
        	        	<description><![CDATA[<p>Hello Tony,</p>
</p>
<p>&#160;&#160; I was able to get it working, but I went the hard way.</p>
</p>
<p>&#160;&#160; Using the afterShowForm just by itself didn&#39;t solve the problem.</p>
<p>&#160;&#160; The focus goes to the description field, but the DatePicker dialog is also open.</p>
<p>&#160;&#160; I also tried to run: $("#date", formid).datepicker(&#39;hide&#39;);&#160;&#160;&#160;&#160; but that also didn&#39;t solve the problem.</p>
</p>
<p>&#160;&#160; The solution I&#39;ve encountered was to:</p>
<p>1. not create the datepicker in colModel definition, in editoptions.</p>
<p>2. Run the command: $("#date", formid).datepicker({ dateFormat:&#39;yy-mm-dd&#39; });&#160;&#160; in afterShowForm, and after the $("#description", formid).focus();</p>
<p>3. Run the command: $("#date", formid).datepicker(&#39;destroy&#39;); in onClose event.</p>
</p>
<p>&#160;&#160; This is working, but it doesn&#39;t "sound" as the polite way to do this.</p>
</p>
<p>Do you suggest any other procedure for me to try?</p>
</p>
<p>Best regards,</p>
<p>Carlos</p>
]]></description>
        	        	<pubDate>Mon, 15 Mar 2010 19:23:28 +0200</pubDate>
        </item>
        <item>
        	<title>tony on Form Edit: Setting the focus to a field</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/form-edit-setting-the-focus-to-a-field#p15525</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/form-edit-setting-the-focus-to-a-field#p15525</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Try to use afterShowForm event when you try to focus description.</p>
<p>Do not forget to set the event in both add and edit</p>
</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Tue, 09 Mar 2010 18:59:01 +0200</pubDate>
        </item>
        <item>
        	<title>carlos.vita on Form Edit: Setting the focus to a field</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/form-edit-setting-the-focus-to-a-field#p15416</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/form-edit-setting-the-focus-to-a-field#p15416</guid>
        	        	<description><![CDATA[<p>Hello,</p>
</p>
<p>I&#39;m trying to have a form, and when the user clicks "add" or "edit", the field with focus should not be the first.</p>
</p>
<p>Allow me to show an example:</p>
<p>--------------------------------------------------------------</p>
<p>Date: __________________</p>
<p>Time: _________</p>
<p>Description: _______________________</p>
<p>----------------------------------------------------------------</p>
<p>"Date" and "Time" values are suggested automaticaly by the system, so the user in 99% of the time will only fill in the "Description" field.</p>
<p>I don&#39;t know if it&#39;s relevant, but the "Date" field is a jQuery datepicker.</p>
</p>
<p>I&#39;ve tryed to use the "beforeShowForm" event, but I had no success.</p>
</p>
<p>...,</p>
<p>beforeShowForm: function (formid) {</p>
<p>&#160;&#160; $("#date", formid).val("2010-03-05");&#160;&#160; // This value is static only for this example and it works.</p>
<p>&#160;&#160; $("#time", formid).val("13:01");&#160;&#160; // This value is static only for this example and it works.</p>
<p>&#160;&#160; $("#description", formid).focus();&#160;&#160; // Not working. Always defaults to the first field.<br />},</p>
<p>...</p>
</p>
<p>It&#39;s not working.</p>
<p>Can anyone please help me?</p>
</p>
<p>Regards,</p>
<p>Carlos</p>
]]></description>
        	        	<pubDate>Fri, 05 Mar 2010 15:05:12 +0200</pubDate>
        </item>
</channel>
</rss>