JQuery-Grid

$(function(){
 // 配置jqGrid组件
 $("#gridedittable").jqGrid({
  url: "partner/policyinsuredgrid_getGridData.action",
  datatype: "json",
  mtype: "post",
  height: 350,
  autowidth: true,
  colModel: [
           {name:"id",index:"id",label:"ID",width:40}, 
        {name:"lastName",index:"lastName",label:"Last Name",width:80,editable:true,sortable:false},
        {name:"firstName",index:"firstName",label:"First Name",width:80,sortable:false},
        {name:"email",index:"email",label:"E-mail",width:160,sortable:false},
        {name:"telNo",index:"telNo",label:"Tel No",width:120,sortable:false}
  ],
  
  viewrecords: true,
  rowNum: 15,
  rowList: [15,50,100],
  prmNames: {search: "search"}, //(1)
  jsonReader: {
   root:"gridModel",  // (2)
   records: "record",  // (3)
   repeatitems : false  // (4)
  },
 
  pager: "#gridPager", 
  hidegrid: false,
  
  editurl: "partner/EditGridEntry.action"
 });
 /*
  var mydata = [
    {id:"1",lastName:"polaris",firstName:"男",email:"[email protected]",telNo:"33334444"},
    {id:"2",lastName:"polaris",firstName:"男",email:"[email protected]",telNo:"33334444"}];
  for(var i=0;i<=mydata.length;i++)
         jQuery("#gridedittable").jqGrid('addRowData',i+1,mydata[i]);*/

});

你可能感兴趣的:(jquery)