<?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: formedit disable fields based on value of another field</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/formedit-disable-fields-based-on-value-of-another-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/formedit-disable-fields-based-on-value-of-another-field/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>maggie on formedit disable fields based on value of another field</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/formedit-disable-fields-based-on-value-of-another-field#p24237</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/formedit-disable-fields-based-on-value-of-another-field#p24237</guid>
        	        	<description><![CDATA[<p>I&#39;ve got a solution:</p>
<p>{name:&#39;reportType&#39;, <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; index:&#39;reportType&#39;, <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; sortable:false, <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; editable:true, <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; edittype:&#39;select&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; editoptions:{ <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; value:{&#39;Active Report&#39;:&#39;Active Report&#39;, &#39;Information Request&#39;:&#39;Information Request&#39;},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; dataEvents :[<br />&#160;&#160;&#160;&#160;&#160;&#160; { type: &#39;change&#39;, <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; fn: function(e) {<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; var thisval = $(e.target).val();<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; // alert ("value: " + thisval);<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; <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; if (thisval=="Information Request") {<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;<strong>//disable the field dateLab</strong></p>
<p><strong>&#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; $(&#39;#dateLab&#39;).attr(&#39;disabled&#39;, &#39;true&#39;);<br /></strong>&#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;<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; }<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; <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; if (thisval=="Active Report") {<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;//enable the field&#160;dateLab</p>
<p>&#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;$(&#39;#dateLab&#39;).removeattr(&#39;disabled&#39;);</p>
<p>&#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; }<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; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }//end func<br />&#160;&#160;&#160;&#160;&#160;&#160; } // end type<br />&#160;&#160;&#160;&#160;&#160;&#160; ] // dataevents<br />&#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; },</p>
<p>&#160;Cheers,</p>
<p>Maggie</p>
]]></description>
        	        	<pubDate>Sat, 13 Aug 2011 00:54:22 +0300</pubDate>
        </item>
        <item>
        	<title>maggie on formedit disable fields based on value of another field</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/formedit-disable-fields-based-on-value-of-another-field#p24235</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/formedit-disable-fields-based-on-value-of-another-field#p24235</guid>
        	        	<description><![CDATA[<p>Hi DJ,</p>
</p>
<p>Thanks for your help. I&#39;ve tried it but it doesn&#39;t work. I want to disable/enable&#160; (or show/hide) a field on the edit form when the selected value of&#160;a select list are changed. Is that doable?</p>
</p>
<p>Thanks, Maggie</p>
]]></description>
        	        	<pubDate>Fri, 12 Aug 2011 17:40:17 +0300</pubDate>
        </item>
        <item>
        	<title>djkuddel on formedit disable fields based on value of another field</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/formedit-disable-fields-based-on-value-of-another-field#p24234</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/formedit-disable-fields-based-on-value-of-another-field#p24234</guid>
        	        	<description><![CDATA[<p>Hi,</p>
</p>
<p>to hide and show column you can use a click event</p>
<p>to Hide a column you can use e.g. this</p>
<p><strong>jQuery("#button").click( function() { 	jQuery("#list").jqGrid(&#39;navGrid&#39;,&#39;hideCol&#39;,"column"); }); </strong></p>
<p>to show a column you can use e.g. this</p>
<p>j<strong>Query("#</strong><strong>button</strong><strong>").click( function() { 	jQuery("#list").jqGrid(&#39;navGrid&#39;,&#39;showCol&#39;,"</strong><strong>column</strong><strong>"); });</strong></p>
</p>
<p>I hope it helps you.</p>
</p>
<p>Best Regards,</p>
<p>DJ</p>
]]></description>
        	        	<pubDate>Fri, 12 Aug 2011 16:37:47 +0300</pubDate>
        </item>
        <item>
        	<title>maggie on formedit disable fields based on value of another field</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/formedit-disable-fields-based-on-value-of-another-field#p24226</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/formedit-disable-fields-based-on-value-of-another-field#p24226</guid>
        	        	<description><![CDATA[<p>I use form edit. I want to disable a field (&#39;Date of Lab Confirmed Diagnosis&#39;)&#160;based on the value of another field (&#39;Report Type&#39;). The field &#39;Report Type&#39; data type is select. I use dataevents "change". But I don&#39;t know the syntax of disabling a field.</p>
</p>
<p>Please see my codes below. Any help is highly appreciated!</p>
</p>
<p>-Maggie</p>
<p>jQuery(document).ready(function(){ <br />&#160;&#160;&#160;&#160;&#160; jQuery("#communicableDiseaseGrid").jqGrid({ <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <a href="http://www.trirand.com/blog/&#39;servlet/communicableDiseaseByDateGrid&#39;" target="_blank">url:&#39;servlet/communicableDiseaseByDateGrid&#39;</a>, <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; datatype: &#39;xml&#39;, <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; colNames:[</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160; &#39;Report Type&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160; &#39;Date Time of Report to HD&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160; &#39;Date of Lab Confirmed Diagnosis&#39;<br />&#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; colModel :[ <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {name:&#39;reportType&#39;, <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; index:&#39;reportType&#39;,&#160;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; editable:true, <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; edittype:&#39;select&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; editoptions:{ <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; value:{&#39;Active_Report&#39;:&#39;Active_Report&#39;, &#39;Information_Request&#39;:&#39;Information_Request&#39;},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;dataEvents :[<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160; { type: &#39;change&#39;, <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160; fn: function(e) {<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;&#160;&#160;&#160;var thisval = $(e.target).val();<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;&#160;&#160; if (thisval=="Active_Report") {<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;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; alert ("it is Information_Request, diable Date of Lab Confirmed Diagnosis ");<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;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<strong>//how to disable the field&#160; &#39;Date of Lab Confirmed Diagnosis&#39;?<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;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160; //?????<br /></strong>&#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;<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;&#160;&#160;&#160;}<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;}//end func<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;} // end type<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;] &#160;// dataevents<br />&#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;},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{name:&#39;dateTimeHD&#39;,&#160;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;index:&#39;dateTimeHD&#39;,&#160;&#160;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;sortable:true,&#160;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;sorttype: "date",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;editable:true,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;editrules:{required:true}<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;},<br />&#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;{name:&#39;dateLab&#39;, <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; index:&#39;dateLab&#39;,&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; sortable:false, <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; editable:true}],<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;viewrecords: true,&#160;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;caption: &#39;Communicable Disease&#39;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }).setGridHeight(150);&#160;</p>
<p>$("#communicableDiseaseButtonEdit").click(function(){<br />&#160;&#160;&#160;&#160;&#160; &#160;var gr = jQuery("#communicableDiseaseGrid").jqGrid(&#39;getGridParam&#39;,&#39;selrow&#39;);<br />&#160;&#160;&#160;&#160;&#160;&#160; if( gr != null ) {<br />&#160;&#160;&#160;&#160;&#160;&#160; &#160;jQuery("#communicableDiseaseGrid").editGridRow(<br />&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;gr,<br />&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;{&#160;&#160; top: 0,<br />&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160; &#160;left: 0, <br />&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160; width: 500, <br />&#160;&#160;&#160;&#160;&#160;&#160; &#160; &#160;&#160;&#160; height:280,<br />&#160;&#160;&#160;&#160;&#160;&#160; &#160; &#160;&#160;&#160; modal:true, <br />&#160;&#160;&#160;&#160;&#160;&#160; &#160; &#160; &#160;drag: true,<br />&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;editCaption:&#160; &#39;Edit Record&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160; &#160; &#160; &#160;bSubmit: "Submit", <br />&#160;&#160;&#160;&#160;&#160;&#160; &#160; &#160;&#160; bCancel: "Cancel",<br />&#160;&#160;&#160;&#160;&#160;&#160; &#160; &#160; &#160;<a href="http://www.trirand.com/blog/&#39;servlet/communicableDiseaseByDateGrid?userAction=update&#39;" target="_blank">url:&#39;servlet/communicableDiseaseByDateGrid?userAction=update&#39;</a>,<br />&#160;&#160;&#160;&#160;&#160;&#160; &#160; &#160;&#160;processData: "Processing...", <br />&#160;&#160;&#160;&#160;&#160;&#160; &#160; &#160;&#160;closeAfterEdit:true,<br />&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;reloadAfterSubmit:true,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;<br />&#160;&#160;&#160;&#160;&#160;&#160; &#160;});<br />&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160; &#160;&#160;else alert("Please Select Row");<br />&#160;&#160;&#160;&#160; });<br />&#160;&#160;</p>
]]></description>
        	        	<pubDate>Fri, 12 Aug 2011 02:01:08 +0300</pubDate>
        </item>
</channel>
</rss>