任何Body都可以告诉我如何在JqGrid中配置主键.由于Jqgrid使用id作为主键但我使用fid作为主键.
Jqgrid的示例:
<!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>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>
<script type="text/javascript">
// Here we set a globally the altRows option
//jQuery.extend(jQuery.jgrid.defaults, { altRows:true });
</script>
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery("#jsonmap").jqGrid({
url:'example.php?q=4',
datatype: "json",
colNames:['FId','Id', 'Colname', 'Index','width','Form Name','Fiel Name','Editable','Show','Extra Field'],
colModel:[
{name:'fid',index:'fid', width:55,size:10,editable:false},
{name:'id',index:'id', width:90,editable:true,size:5}, /*name : database …Run Code Online (Sandbox Code Playgroud)