<?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: Local Data and addRowData Problem</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/local-data-and-addrowdata-problem-1</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/local-data-and-addrowdata-problem-1/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>dgoldman on Local Data and addRowData Problem</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/local-data-and-addrowdata-problem-1#p6825</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/local-data-and-addrowdata-problem-1#p6825</guid>
        	        	<description><![CDATA[<p>I thought I had posted this, but I can&#39;t find it anywhere, so I&#39;m reposting. Sorry if this duplicates.&#160;</p>
<p><div>I&#39;m a new user to jqgrid and have managed to figure out most of what I need. I have no problem with checkboxes and select lists on json fed pages, but I can&#39;t get them to show up when I use datatype:local.</div>
<div></div>
<div>If I define a column to be a checkbox and then used the addRowData method to create a row - what shows up in the checkbox column is a "1" - not a checked box. When I look the rendered HTML its "&#60;td title="0"&#62;0&#60;/td&#62;". Here is a snippet of the problematic code.</div>
<div></div>
<div>
<div></div>
<div>
<div>&#60;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"</div>
<div>"http://www.w3.org/TR/html4/strict.dtd"&#62;</div>
<div>&#60;html&#62;</div>
<div><span> </span>&#60;head&#62;</div>
<div><span> </span>&#60;title&#62;Test&#60;/title&#62;</div>
<div><span> </span>&#60;link rel="StyleSheet" type="text/css" href="/css/main.css" media="all"/&#62;</div>
<div><span> </span>&#60;link rel="StyleSheet" type="text/css" href="/js/jqGrid-3-1/themes/steel/grid.css" media="all"/&#62;</div>
<div><span> </span>&#60;script LANGUAGE="javascript" src="/js/jquery-1.3.2.js"&#62;&#60;/script&#62;</div>
<div><span> </span>&#60;script LANGUAGE="javascript" src="/js/jqGrid-3-1/jquery.jqGrid.js"&#62;&#60;/script&#62;</div>
<div><span> </span>&#60;script LANGUAGE="JavaScript"&#62;</div>
<div></div>
<div><span> </span></div>
<div><span> </span>$(document).ready(function () {</div>
<div><span> </span>&#160;</div>
<div><span> </span>jQuery("#sensorgrid").jqGrid({</div>
<div><span> </span>&#160;&#160; datatype: "local",</div>
<div><span> </span></div>
<div><span> </span>&#160;&#160; colNames:["ID","Graph?","Table?","Description","Axis","Style","Type","Interval"],</div>
<div><span> </span>&#160;&#160; colModel:[</div>
<div><span> </span>{name:&#39;id&#39;,index:&#39;id&#39;, width:30},</div>
<div><span> </span>{name:&#39;graph&#39;,index:&#39;graph&#39;, width:30,editable:true, edittype:"checkbox",editoptions: {value:"1:0"}},</div>
<div><span> </span>{name:&#39;table&#39;,index:&#39;table&#39;, width:30,editable:true, edittype:"checkbox",editoptions: {value:"1:0"}},</div>
<div><span> </span>{name:&#39;desc&#39;,index:&#39;desc&#39;, width:225},</div>
<div><span> </span>{name:&#39;a&#39;,index:&#39;a&#39;, width:100,editable:true,edittype:"select",formatter:&#39;select&#39;,editoptions:{value:"0:Hide;1:Left;2:Right"}}, &#160;</div>
<div><span> </span>{name:&#39;s&#39;,index:&#39;s&#39;, width:100,editable:true,edittype:"select",formatter:&#39;select&#39;,editoptions:{value:"0:Raw;1:Sum;2:Delta;3:Minimum;4:Maximum;5:Average;6:Running Ave;7:Mean"}}, &#160;</div>
<div><span> </span>{name:&#39;t&#39;,index:&#39;t&#39;, width:100,editable:true,edittype:"select",formatter:&#39;select&#39;,editoptions:{value:"1:Points;2:Lines;3:Lines+Points;4:Impulse;5:Boxes;6:Impulses"}}, &#160;</div>
<div><span> </span>{name:&#39;i&#39;,index:&#39;i&#39;, width:50,editable:true,edittype:"select",formatter:&#39;select&#39;,editoptions:{value:"0:None;1:Hour;2:Day;3:Week;4:Month;5:Year"}}</div>
<div><span> </span>&#160;&#160; ],</div>
<div><span> </span></div>
<div><span> </span>&#160;&#160; rowNum:10,</div>
<div><span> </span>&#160;&#160; imgpath: "js/jqGrid-3-1/themes/steel/images",</div>
<div><span> </span>&#160;&#160; sortname: &#39;id&#39;,</div>
<div><span> </span>&#160;&#160; height: 200,</div>
<div><span> </span>&#160;&#160; viewrecords: true,</div>
<div><span> </span>&#160;&#160; sortorder: "asc",</div>
<div><span> </span>&#160;&#160; caption:"Sensors to Plot"</div>
<div><span> </span>}); &#160;</div>
<div><span> </span>row = {</div>
<div><span> </span>id:"1",</div>
<div><span> </span>graph:"0",</div>
<div><span> </span>table:"0",</div>
<div><span> </span>desc:"",</div>
<div><span> </span>a:"1",</div>
<div><span> </span>s:"0",</div>
<div><span> </span>t:"2",</div>
<div><span> </span>i:"0"</div>
<div><span> </span>&#160;};</div>
<div><span> </span></div>
<div><span> </span>jQuery("#sensorgrid").addRowData(1, row);</div>
<div><span> </span></div>
<div><span> </span>});</div>
<div><span> </span></div>
<div><span> </span>&#60;/script&#62; &#160;</div>
<div><span> </span></div>
<div><span> </span>&#60;/head&#62;</div>
<div><span> </span>&#60;body&#62;</div>
<div><span> </span>&#60;table id="sensorgrid" class="scroll" cellpadding="0" cellspacing="0"&#62;&#60;/table&#62;</div>
<div><span> </span>&#60;/body&#62;</div>
<div>&#60;/html&#62;</div>
<div></div>
<div>Any help??</div>
<div></div>
<div>-- David</div>
</div>
</div>
]]></description>
        	        	<pubDate>Wed, 20 May 2009 22:07:09 +0300</pubDate>
        </item>
</channel>
</rss>