<?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: jquery.fmatter.js : wrong value when unformat checkbox</title>
	<link>http://www.trirand.com/blog/?page_id=393/bugs/jqueryfmatterjs-wrong-value-when-unformat-checkbox</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/bugs/jqueryfmatterjs-wrong-value-when-unformat-checkbox/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tony on jquery.fmatter.js : wrong value when unformat checkbox</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/jqueryfmatterjs-wrong-value-when-unformat-checkbox#p9520</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/jqueryfmatterjs-wrong-value-when-unformat-checkbox#p9520</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Thanks will check this.</p>
<p>Regards</p></p>
]]></description>
        	        	<pubDate>Wed, 09 Sep 2009 09:24:12 +0300</pubDate>
        </item>
        <item>
        	<title>zerikv on jquery.fmatter.js : wrong value when unformat checkbox</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/jqueryfmatterjs-wrong-value-when-unformat-checkbox#p9514</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/jqueryfmatterjs-wrong-value-when-unformat-checkbox#p9514</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>I use a grid loaded with JSON data. In this grid I have a cell which contain a checkbox.<br />After a load by addJSONData, if I look the value of the checkbox returned by getRowData, this value is ever &#8220;no&#8221;<br />regardless the real value in the JSON data.</p>
<p>I have followed the code with firebug and found that the value of the checkbox is retrieved in the HTML of the cell<br />by the function &#8220;unformat&#8221; in &#8220;jquery.fmatter.js&#8221; (line 324 / jqGrid 3.5.2).</p>
<p>The value of the checkbox is calculated line 359 in &#8220;jquery.fmatter.js&#8221;</p>
<p><input type='button' class='sfcodeselect' name='sfselectit8214' value='Select Code' data-codeid='sfcode8214' /></p>
<div class='sfcode' id='sfcode8214'>ret = $(&#39;input&#39;,cellval).attr(&#8221;checked&#8221;) ? cbv[0] : cbv[1];</div>
<p>In my case the variables have the following values:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit6987' value='Select Code' data-codeid='sfcode6987' /></p>
<div class='sfcode' id='sfcode6987'>cbv[0]&#160;&#160;&#160; &#160;&#160;&#160; &#8220;yes&#8221;<br />cbv[1]&#160;&#160;&#160; &#160;&#160;&#160; &#8220;no&#8221;<br />cellvall&#160;&#160;&#160; &#8220;&#60;input disabled=&#8221;disabled&#8221; checked=&#8221;checked&#8221; value=&#8221;yes&#8221; offval=&#8221;no&#8221; type=&#8221;checkbox&#8221;&#62;&#8221;<br />options.colModel.editoptions<br />&#160;&#160;&#160; value&#160;&#160;&#160; &#8220;yes:no&#8221;</div>
<p>According firebug the function &#8220;attr&#8221; return &#8220;undefined&#8221;, so the checkbox&#39;s value is ever returned to &#8220;no&#8221;.</p>
<p>I have changed the test when the "cellval" variable is a String:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit8782' value='Select Code' data-codeid='sfcode8782' /></p>
<div class='sfcode' id='sfcode8782'>if(typeof cellval == "object"){<br />&#160;&#160;&#160; ret = $(&#39;input&#39;,cellval).attr("checked") ? cbv[0] : cbv[1];<br />}else{<br />&#160;&#160;&#160; ret = (cellval.indexOf("checked")!=-1) ? cbv[0] : cbv[1];<br />}</div>
<p>That works fine for me.</p>
<p>What do you think about that ?</p>
]]></description>
        	        	<pubDate>Wed, 09 Sep 2009 07:39:27 +0300</pubDate>
        </item>
</channel>
</rss>