<?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: Image instead  of checkbox</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/image-instead-of-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/help/image-instead-of-checkbox/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>samarcus971 on Image instead  of checkbox</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/image-instead-of-checkbox#p20386</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/image-instead-of-checkbox#p20386</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>I&#160;try to use image instead of checkbox with a custom formatter but I cant retreive the original value back.</p>
<p>Here&#160;is my code</p>
<p>.......</p>
<pre id="line85">            colModel : [
                    {name:&#39;TXTBLOG&#39;, index:&#39;TXTBLOG&#39;, width:310, editable:true, sortable:false, edittype:&#39;textarea&#39;, 
                           editoptions:{rows:&#39;3&#39;,cols:&#39;40&#39;, size:200}, editrules:{required:true}}, 
                    {name:&#39;EXPBLOG&#39;, index:&#39;EXPBLOG&#39;, width:130, editable:true, align:&#39;left&#39;, editrules:{required:true}}, 
                    {name:&#39;DTHRPOST&#39;, index:&#39;DTHRPOSTBLOG&#39;, editable:false, width:80, align:&#39;center&#39;, formatter:&#39;DtHrFormat&#39;}, 
                    {name:&#39;QUIVALIDBLOG&#39;, index:&#39;QUIVALIDBLOG&#39;, editable:true, width:100, align:&#39;center&#39;, sortable:true}, 
                    {name:&#39;DTHRVALIDBLOG&#39;, index:&#39;DTHRVALIDBLOG&#39;, editable:false, width:80, align:&#39;center&#39;, formatter:&#39;DtFormat&#39;},
                    {name:&#39;OBSBLOG&#39;, index:&#39;OBSBLOG&#39;, width:80, editable:true, align:&#39;left&#39;, edittype:&#39;textarea&#39;, editoptions:{rows:&#39;3&#39;,cols:&#39;40&#39;, size:20},
                           hidden:true, editrules:{edithidden:true}},
                    {<strong>name:&#39;ONVF&#39;, index:&#39;ONVF&#39;, width:50, align:&#39;center&#39;, editable:true, sortable:false, edittype:&#39;checkbox&#39;, editoptions:{value:&#39;1:0&#39;}, formatter:&#39;CheckboxCase&#39;}</strong>
                         ],
   ......</pre>
<pre></pre>
<pre id="line85">  </pre>
<pre id="line85">       jQuery.extend($.fn.fmatter , {
</pre>
<pre id="line85">             CheckboxCase : function(cellvalue, options, rowdata) {
	       var img_checkbox;
                       var etiquette= TimeStampToDtJscript(rowdata.childNodes[4].textContent, 1);
                       return img_checkbox = cellvalue==0 ? "&#60;img src=&#39;crossred.png&#39;  style=&#39;border:0&#39; width=&#39;12&#39; height=&#39;10&#39; <strong>originalValue=&#39;0&#39;</strong> /&#62;" : "&#60;img src=&#39;images/Icones/cocheverte.png&#39; style=&#39;border:0&#39; width=&#39;12&#39; height=&#39;10&#39;  originalValue=&#39;1&#39; /&#62;";
                     }
</pre>
<p>});</p>
<pre></pre>
<pre id="line85">         jQuery.extend($.fn.fmatter.CheckboxCase , {
           unformat : function (cellvalue, options, cellObject) {
		              return $(cellObject.html()).attr("originalValue");
           }
       });
</pre>
<pre>First time, when the grid is loaded, images are ok  depending on the value of the checkbox. When I click to edit form (on navigator bar) , the very first time, I get the good value and the checkbox in formedit is correct. But other time, even on the same row, Firebug says "cellObject.html() is not a function". And checked or not, I always get the same value.</pre>
<pre>Can anyone help me ?</pre>
<pre>Thanks a lot</pre>
]]></description>
        	        	<pubDate>Wed, 20 Oct 2010 20:36:56 +0300</pubDate>
        </item>
</channel>
</rss>