<?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: celledit vs formedit with multiple select</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/celledit-vs-formedit-with-multiple-select</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/celledit-vs-formedit-with-multiple-select/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tony on celledit vs formedit with multiple select</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/celledit-vs-formedit-with-multiple-select#p15264</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/celledit-vs-formedit-with-multiple-select#p15264</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>If your code work as you want then this is great.</p>
<p>Best Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Mon, 01 Mar 2010 20:36:54 +0200</pubDate>
        </item>
        <item>
        	<title>billy on celledit vs formedit with multiple select</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/celledit-vs-formedit-with-multiple-select#p15204</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/celledit-vs-formedit-with-multiple-select#p15204</guid>
        	        	<description><![CDATA[</p>
<p>Hi,</p>
<p>If i look at postdata for a multiple selectbox using <strong>formedit</strong> I can see that the selected values get combined like so:</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit989' value='Select Code' data-codeid='sfcode989' /></p>
<div class='sfcode' id='sfcode989'>$_POST[&#39;people&#39;]&#160; = 1,3,756,615,421,201</div>
</p>
<p>However the same cell usings <strong>celledit</strong> does not combine the selected values and outputs:</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit8426' value='Select Code' data-codeid='sfcode8426' /></p>
<div class='sfcode' id='sfcode8426'>people 1<br />people 3<br />people 756<br />people 615<br />people 421<br />people 201</div>
</p>
<p>which is a problem because $_POST[&#39;people&#39;] will then only grab the last one like:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit7632' value='Select Code' data-codeid='sfcode7632' /></p>
<div class='sfcode' id='sfcode7632'>$_POST[&#39;people&#39;]&#160; = 201</div>
</p>
<p>I can make my own combined variable by doing this:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit714' value='Select Code' data-codeid='sfcode714' /></p>
<div class='sfcode' id='sfcode714'>beforeSubmitCell : function(rowid,cellname,value,iRow,iCol) {<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;&#160;&#160; &#160;if( cellname == &#34;people&#34; )<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;&#160;&#160; &#160;var peopleData = &#34;&#34;;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;var counter = 0;<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;&#160;&#160; &#160;$(value).each(function(i, selected) <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;&#160;&#160; &#160;&#160;&#160; &#160;peopleData += selected;<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;&#160;&#160; &#160;if(counter&#60;$(value).length &#8211; 1)<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;&#160;&#160; &#160;&#160;&#160; &#160;peopleData += &#34;,&#34;;&#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;} <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;counter++;<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;&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;return { &#39;peopleData&#39;:peopleData }<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;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160; }</div>
</p>
<p>Is this the best way to submit multiple select values via cellEdit? or have I missed something that would be a better solution</p>
</p>
<p>thanks again!</p></p>
]]></description>
        	        	<pubDate>Fri, 26 Feb 2010 23:16:10 +0200</pubDate>
        </item>
</channel>
</rss>