Forum
November 2nd, 2014
A
A
A
The forums are currently locked and only available for read only access
Topic RSS
Problem with local data
25/05/2009
00:45
00:45
dgoldman
Member
Members
Forum Posts: 3
Member Since:
20/05/2009
20/05/2009
Offline
I had posted this to the help section and received no responses, so I'm trying here. I was thinking I was doing something wrong, but now feel this could actually be a bug.
I have no problem with checkboxes and select lists on json fed pages, but I can't get them to show up when I use 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”
<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
25/05/2009
01:36
01:36
tony
Sofia, Bulgaria
Moderator
Members
Moderators
Moderators
Forum Posts: 7721
Member Since:
30/10/2007
30/10/2007
Offline
Hello,
Also these options are for the editing. In order to show them in the grid use formatter:'checkbox'
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
Forum Timezone: Europe/Sofia
Most Users Ever Online: 715
Currently Online:
75 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