MyException - 我的异常网
当前位置:我的异常网» J2EE » 求教jqgrid用jsp的兑现

求教jqgrid用jsp的兑现(2)

www.MyException.Cn  网友分享于:2013-12-27  浏览:199次

  ],  
  pager: '#pager', //分页工具栏  
  imgpath: 'themes/redmond/images', //图片路径  
  rowNum:10, //每页显示记录数  
  viewrecords: true, //是否显示行数  
  rowList:[10,20,30], //可调整每页显示的记录数  
  multiselect: false, //是否支持多选  
  sortname: 'id',//根据哪个字段排序  
  caption: "jqGrid表格测试", //表格标题
  recordtext: "记录 {0} - {1} of {2}",//显示记录数的格式
  emptyrecords: "无数据",//空记录时的提示信息
  loadtext: "获取数据中...",//获得数据时的提示信息
  pgtext : "第几页 {0} 总页数 {1}"//页数显示格式
  });  
  
  var mydata = [  
  {id:"1",invdate:"2007-10-01",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},  
  {id:"2",invdate:"2007-10-02",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},  
  {id:"3",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"},  
  {id:"4",invdate:"2007-10-04",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},  
  {id:"5",invdate:"2007-10-05",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},  
  {id:"6",invdate:"2007-09-06",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"},  
  {id:"7",invdate:"2007-10-04",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},  
  {id:"8",invdate:"2007-10-03",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},  
  {id:"9",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"}, 
  {id:"11",invdate:"2008-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"},
  {id:"10",invdate:"2009-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"},
  {id:"12",invdate:"2017-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"}  
  ];  
  for(var i=0;i<=mydata.length;i++)  
  jQuery("#list1").addRowData(i+1,mydata[i]);  
   
});  
</script>  
<body>  
  <!-- 调用表格并分页 -->
  <table id="list1" class="scroll" cellpadding="0" cellspacing="0"></table>  
  <div id="pager" class="scroll"></div>  
</body>  

  </head>
  
  <body>

  </body>
</html>




------解决方案--------------------
刚想回答你呢 你就搞出来了 下次搞慢点。jqgrid之前我也在用,蛮不错的 ,不过一开始上手确实很郁闷。

文章评论

软件开发程序错误异常ExceptionCopyright © 2009-2015 MyException 版权所有