我使用数据类型:“local”,JqGrid是最新的 - 4.2 如果我添加或编辑数据,数据在网格中不会更改。使用Fiddler我看,所有信息都发送到editurl。
JavaScript的:
jQuery(document).ready(function(){
var mydata = [
{id:"1",name:"test",note:"note"},
{id:"2",name:"test2",note:"note2"},
{id:"3",name:"test3",note:"note3"}
];
jQuery("#list4").jqGrid({
data:mydata,
datatype: "local",
colNames:['ID','Client', 'Notes'],
colModel:[
{name:'id',index:'id', width:60, sorttype:"int",editable:true,editoptions:{size:10}},
{name:'name',index:'name', width:100,editable:true,editoptions:{size:10}},
{name:'note',index:'note', width:150, editable:true,editoptions:{size:20}} ],
editurl:"someurl.php",
pager: '#pcrud',
viewrecords: true,
gridview: true,
width:300
})
jQuery("#list4").jqGrid('navGrid','#pcrud',{});
});
HTML:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>My First PHP jqGrid </title>
<link rel="stylesheet" type="text/css" media="screen" href="themes/redmond/jquery-ui-1.8.2.custom.css" />
<link rel="stylesheet" type="text/css" media="screen" href="themes/ui.jqgrid.css" />
<script src="js/jquery-1.5.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>
</head>
<body>
<table id="list4"></table>
<div id="pcrud"></div>
<script src="mygrid.js" type="text/javascript"></script>
</body>
答案 0 :(得分:1)
在SO上已经介绍了几次....你需要使用魔术字符串'clientArray'作为editurl配置选项的值。