Forum
November 2nd, 2014
A
A
A
Topic RSS
Offline
The forums are currently locked and only available for read only access


Local Data and addRowData Problem
20/05/2009
12:37
12:37

dgoldman
Member
Members
Forum Posts: 3
Member Since:
20/05/2009
20/05/2009

I'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't get them to show up with datatype:local. 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 "<td title="0">0</td>". Here is a snippet of the problematic code.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Test</title>
<link rel="StyleSheet" type="text/css" href="/css/main.css" media="all"/>
<link rel="StyleSheet" type="text/css" href="/js/jqGrid-3-1/themes/steel/grid.css" media="all"/>
<script LANGUAGE="javascript" src="/js/jquery-1.3.2.js"></script>
<script LANGUAGE="javascript" src="/js/jqGrid-3-1/jquery.jqGrid.js"></script>
<script LANGUAGE="JavaScript">
$(document).ready(function () {
jQuery("#sensorgrid").jqGrid({
datatype: "local",
colNames:["ID","Graph?","Table?","Description","Axis","Style","Type","Interval"],
colModel:[
{name:'id',index:'id', width:30},
{name:'graph',index:'graph', width:30,editable:true, edittype:"checkbox",editoptions: {value:"1:0"}},
{name:'table',index:'table', width:30,editable:true, edittype:"checkbox",editoptions: {value:"1:0"}},
{name:'desc',index:'desc', width:225},
{name:'a',index:'a', width:100,editable:true,edittype:"select",formatter:'select',editoptions:{value:"0:Hide;1:Left;2:Right"}},
{name:'s',index:'s', width:100,editable:true,edittype:"select",formatter:'select',editoptions:{value:"0:Raw;1:Sum;2:Delta;3:Minimum;4:Maximum;5:Average;6:Running Ave;7:Mean"}},
{name:'t',index:'t', width:100,editable:true,edittype:"select",formatter:'select',editoptions:{value:"1:Points;2:Lines;3:Lines+Points;4:Impulse;5:Boxes;6:Impulses"}},
{name:'i',index:'i', width:50,editable:true,edittype:"select",formatter:'select',editoptions:{value:"0:None;1:Hour;2:Day;3:Week;4:Month;5:Year"}}
],
rowNum:10,
imgpath: "js/jqGrid-3-1/themes/steel/images",
sortname: 'id',
height: 200,
viewrecords: true,
sortorder: "asc",
caption:"Sensors to Plot"
});
row = {
id:"1",
graph:"0",
table:"0",
desc:"",
a:"1",
s:"0",
t:"2",
i:"0"
};
jQuery("#sensorgrid").addRowData(1, row);
});
</script>
</head>
<body>
<table id="sensorgrid" class="scroll" cellpadding="0" cellspacing="0"></table>
</body>
</html>
Any help??
-- David
Forum Timezone: Europe/Sofia
Most Users Ever Online: 715
Currently Online:
165 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66