<?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: Custom Dynamic Editing Forms with validation</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/custom-dynamic-editing-forms-with-validation</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/custom-dynamic-editing-forms-with-validation/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>bujinwang on Custom Dynamic Editing Forms with validation</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-dynamic-editing-forms-with-validation#p7442</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-dynamic-editing-forms-with-validation#p7442</guid>
        	        	<description><![CDATA[<p>Hi,</p>
<p>I have resolved the issue myself, but not sure whether it&#39;s the best.</p>
<p>In beforeShowForm event, we can do initialize the editing form.</p>
<p>for example hide certain fields:</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; $(&#39;#tr_spentTrigger&#39;, formId).hide();<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $(&#39;#tr_freqTrigger&#39;, formId).hide();<br />and dynamicly hide/show fields:</p>
<p>$(&#39;#rewardType&#39;, formId).change(function(){<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var index = $(this)[0].selectedIndex;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; console.log("reward type selected" + ", selcted index: " + index);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (index == 4) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $(&#39;#tr_freqTrigger&#39;, formId).show();<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $(&#39;#tr_spentTrigger&#39;, formId).hide();<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; else <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (index == 5) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $(&#39;#tr_spentTrigger&#39;, formId).show();<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $(&#39;#tr_freqTrigger&#39;, formId).hide();<br />&#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; else {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $(&#39;#tr_spentTrigger&#39;, formId).hide();<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $(&#39;#tr_freqTrigger&#39;, formId).hide();<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; });</p>
<p>where formId is the edit form.</p>
</p>
<p>Burt</p>
]]></description>
        	        	<pubDate>Wed, 24 Jun 2009 11:23:56 +0300</pubDate>
        </item>
        <item>
        	<title>bujinwang on Custom Dynamic Editing Forms with validation</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-dynamic-editing-forms-with-validation#p7427</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-dynamic-editing-forms-with-validation#p7427</guid>
        	        	<description><![CDATA[<p>Hi all(Tony),</p>
</p>
<p>I found in documentation an example on CheckInvoice where you can do dynamic editing forms. However, I just can&#39;t figure out where this CheckInvoice function should be hooked with?</p>
<p>in editrules? How?</p>
<p>function CheckInvoice(formid) { var invno = &#39;invoice=&#39; + $("#invoice",formid).val() ; if (invno == &#39;invoice=&#39;) { alert("invoice is blank; please enter account #") } else { $.getJSON(searchinvoice, invno, function(data) { if (data.status == &#39;No match found; please try again&#39;) { alert(data.status) } else { // Load the fields we know about $("#invoiced",formid).val(data.invoiced); $("#outstanding",formid).val(data.os); $("#acctname",formid).val(data.account); $("#project",formid).val(data.project); // Disabled loaded fields $("#acctname",formid).attr(&#39;disabled&#39;,true); $("#project",formid).attr(&#39;disabled&#39;,true); // Hide unneeded fields $("#tr_comment",formid).hide(); $("#tr_projectnumber",formid).hide(); $("#tr_shorttitle",formid).hide(); $("#tr_client",formid).hide();</p>
<p>Regards,</p>
</p>
<p>Burt</p></p>
]]></description>
        	        	<pubDate>Tue, 23 Jun 2009 13:28:21 +0300</pubDate>
        </item>
</channel>
</rss>