<?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 select multiple size problem</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/formedit-select-multiple-size-problem</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-select-multiple-size-problem/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tony on formedit select multiple size problem</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/formedit-select-multiple-size-problem#p6064</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/formedit-select-multiple-size-problem#p6064</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>If you dynamically load this the option does not have sense, since the element is already created and you fill data in already created element from jqGrid. You should this manually whitin the request.</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Thu, 16 Apr 2009 02:28:19 +0300</pubDate>
        </item>
        <item>
        	<title>akremedy on formedit select multiple size problem</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/formedit-select-multiple-size-problem#p6030</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/formedit-select-multiple-size-problem#p6030</guid>
        	        	<description><![CDATA[<p>Thanks Tony, that&#39;s strange, I re-tested, but the behavior is the same...select multiple ignores the editoption size:5 (verified too with size:"5").&#160; I&#39;m thinking this has to do with the fact that I&#39;m dynamically fetching my options list in the pager with beforeShowForm:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit711' value='Select Code' data-codeid='sfcode711' /></p>
<div class='sfcode' id='sfcode711'>&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; }).navGrid("#"+pager_id,<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {edit:false,search:false},<br />&#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; {height:160,<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;mtype:&#39;POST&#39;,<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;addCaption:&#39;Add Link to People&#39;,<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; beforeShowForm:function(formid){<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; $.ajax({<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; url:".assets/admin_people_tbl.php?oper=selpplsel",<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; datatype:"script",<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; mtype:"POST",<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; success:function(response) {<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; $(&#39;#username&#39;,formid).children().remove().end().html(response);<br />&#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; })<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; },</div>
<p>so, in createEl, so.length always gets returned as 1, and Math.min(options.size,so.length) sets the size to 1.</p>
<p>Maybe I&#39;ll hardcode an options list to see if the behavior changes - I&#39;m better so.length would return the expected value and the size parameter would be honored (or so.length...whichever was smaller).</p>
<p>Thanks,</p>
<p>Adam</p>
]]></description>
        	        	<pubDate>Tue, 14 Apr 2009 13:37:41 +0300</pubDate>
        </item>
        <item>
        	<title>tony on formedit select multiple size problem</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/formedit-select-multiple-size-problem#p6014</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/formedit-select-multiple-size-problem#p6014</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>The size options work for me. Maybe you set is as string. Try as number.</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Tue, 14 Apr 2009 03:46:18 +0300</pubDate>
        </item>
        <item>
        	<title>akremedy on formedit select multiple size problem</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/formedit-select-multiple-size-problem#p5975</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/formedit-select-multiple-size-problem#p5975</guid>
        	        	<description><![CDATA[<p>Hi Tony, I&#39;ve run into a situation with formedit and (multiple) select fields where the "size:#" editoption is not honored.&#160; The multi-select field is always constructed with size="1".&#160; I am dynamically fetching my select options via beforeShowForm in the pager.</p>
<p>I can hack grid.common.js (line 236 in the 3.5A2 release) replacing:</p>
<p>size:Math.min(options.size,so.length)</p>
<p>- with -</p>
<p>size:options.size</p>
<p>but this defeats the feature of dynamically sized multi-selects when the options list is shorter than the defined size parameter.</p>
<p>What I notice is that so.length is always returned as 1.&#160; My guess is that this is "as expected" under the circumstance since createEl doesn&#39;t know how many options exist until well after the actual form is rendered.&#160; Does that sound about right?</p>
<p>I did this instead, which still seems clumsy, but if the answer to the question above is "yes", then I can&#39;t really think of a more elegant way to handle this outside of maybe an afterShowForm $(&#39;#field&#39;).attr(&#39;size&#39;,#) which still defeats the dynamic resize that I think was intended.</p>
<p><input type='button' class='sfcodeselect' name='sfselectit6742' value='Select Code' data-codeid='sfcode6742' /></p>
<div class='sfcode' id='sfcode6742'>&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; var so = options.value.split(";"),sv, ov;<br />//begin: multi-select hack for setting field length with dynamic options<br />//&#160;&#160;&#160;&#160;&#160;&#160; in colModel editoptions, include &#39;fixedsize:#&#39; param.<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; if(options.fixedsize) {<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; size = options.fixedsize;<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; size = Math.min(options.size,so.length);<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; jQuery(elem).attr({id:options.id,name:options.name,size:Math.min(options.size,so.length) });<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; jQuery(elem).attr({id:options.id,name:options.name,size:size });<br />//end: multi-select hack for setting field length with dynamic options<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; for(var i=0; i&#60;so.length;i++){</div>
<p>Thanks for any feedback, especially if I&#39;m totally off-base and have just missed something simple,</p>
<p>Adam</p>
]]></description>
        	        	<pubDate>Mon, 13 Apr 2009 14:54:13 +0300</pubDate>
        </item>
</channel>
</rss>