jqGrid 是一个用来显示网格数据的jQuery插件,文档比较全面,附带中文版本。
主要特点:
-Full control with JavaScript API
-Data returned from the server is XML
-Simple configuration
-Ability to load big datasets (paging)
-Resizable columns
-Server-side sorting
-Support of links, images, checkboxes
-You can add more than one grid on a sigle page (master-detail)
-Paging
新闻信息列表
$.jgrid.no_legacy_api = true;
$.jgrid.useJSON = true;
jQuery("#list2").jqGrid({
url:'data/data.php',
datatype: "json",
colNames:['编号','标题', '分类', '作者','发布时间','状态','点击'],
colModel:[
{name:'id',index:'id', width:55,align:"center"},
{name:'title',index:'title', width:200,align:"center"},
{name:'typeid',index:'typeid asc, title', width:70,align:"center"},
{name:'author',index:'author', width:80, align:"center"},
{name:'inputtime',index:'inputtime', width:80, align:"center"},
{name:'status',index:'status', width:80,sortable:false,align:"center"},
{name:'hits',index:'hits', width:70, sortable:true,align:"center"}
],
rowNum:6,
rowList:[10,20,30],
pager: '#pager2',
sortname: 'id',