Forum
21:05
14/01/2011
Here is the full example that you can copy and paste.
Select one or two checkboxes, in the last 2 columns, and after doing a sort or a filter, their values are reset.
Any tips? Textfields work fine!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8″ />
<title>My First Grid</title><link rel="stylesheet" type="text/css" media="screen" href="css/ui.jqgrid.css" />
<style>
html,
body {
margin: 0;
padding: 0;
font-size: 75%;
}
</style>
<script src="js/jquery-1.4.2.min.js" type="text/javascript"></script>
<script src="js/i18n/grid.locale-en.js" type="text/javascript"></script>
<script src="js/jquery.jqGrid.min.js" type="text/javascript"></script>
<script type="text/javascript">$(function(){
var grid_data =
[
{id:"1",service:"hehehe",ko:"9",first_name:"John",last_name:"Kan",username:"Fityisz",password:"KAKSYAKA",selected:"Yes",completed:"Yes"},
{id:"2",service:"hahaha",ko:"9",first_name:"John",last_name:"Kan",username:"Fityisz",password:"KAKSYAKA",selected:"No",completed:"No"},
{id:"3",service:"huhuhu",ko:"9",first_name:"John",last_name:"Kan",username:"Fityisz",password:"bhjbjhbj",selected:"No",completed:"Yes"},
];jQuery("#list").jqGrid({
cellEdit:true,
cellsubmit: "clientArray",
datatype: "local",
loadonce: true,
data: grid_data,
rowNum: 10,
//height: 'auto',
viewrecords: true,
colNames:['id','Service','PR','First Name','Last Name','Username','Password','Selected','Completed'],
colModel:[
{name:'id',index:'id',width:60,sorttype:"int",hidden:true},
{name:'service',index:'service',width:90,sorttype:"text"},
{name:'pr',index:'pr',width:30,sorttype:"int"},
{name:'first_name',index:'first_name',width:100,sorttype:"text",editable:true},
{name:'last_name',index:'last_name',width:100,sorttype:"text",editable:true},
{name:'username',index:'username',width:100,align:"right",sorttype:"text",editable:true},
{name:'password',index:'password',width:100,align:"right",sorttype:"text",editable:true},
{name:'selected',index:'selected',width:90,editable:true, edittype:'checkbox', editoptions: { value:"Yes:No"}, formatter: "checkbox", formatoptions: {disabled : false},sorttype:"text",searchoptions: { sopt: ['eq'], value:":All;Yes:Yes;No:No" }, stype: 'select'},
{name:'completed',index:'completed',width:100,editable:true, edittype:'checkbox', editoptions: { value:"Yes:No"}, formatter: "checkbox", formatoptions: {disabled : false},sorttype:"text",searchoptions: { sopt: ['eq'], value:":All;Yes:Yes;No:No" }, stype: 'select'},
],
multiselect: true,
filterToolbar: true,
scroll: 1,
height: "200″,
//toolbar:[true,"both"],
pager: "#pager",
caption: "Accounts" });
jQuery("#list").jqGrid('navGrid','#pager',
{view:false,add:false,del:false}
).jqGrid('navButtonAdd', '#pager',{id:"showhide",caption:"Show/Hide Columns"});
jQuery("#showhide").click(function() {
jQuery("#list").setColumns();
return false;
});
jQuery("#list").jqGrid('filterToolbar', {autosearch:true});
//$("#list").searchGrid({ } );
});
</script>
</head>
<body><table id="list"></table>
<div id="pager"></div>
</body>
</html>
10:29
14/01/2011
Hi,
I identified what is wrong, and posted it as a bug. For more details check here
http://www.trirand.com/blog/?p.....te/#p21701
PS: There is a tiny type in the example at the height row, accidentally there is a "?" mark that needs to be replaced with a "
Most Users Ever Online: 715
Currently Online:
30 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