$('#myGrid').jqGrid({
datatype: "local",
height: 250,
width: 572,
colNames: ['档案ID', '档案名称', '档案类型'],
colModel: [
{ name: 'sid', index: 'sid', width: 100, sorttype: 'int' },
{ name: 'title', index: 'title', width: 240 },
{ name: 'type', index: 'type' }
],
rowNum: 10, //每页显示记录数
viewrecords: true, //是否显示行数
rowList: [10, 20, 50], //可调整每页显示的记录数
multiselect: true,
caption: "档案信息列表"
});
//步骤3:添加数据
var dataRow1 = {sid: 'G54E49001',title:'1:2.5万地形图(54系)(E-49-003)',type: '1:2.5万地形图'};
var dataRow2 = {sid: 'G54E49002', title: '1:2.5万地形图(54系)(E-49-003)', type: '1:2.5万地'};
var dataRow3 = {sid: 'G54E49003',title:'1:2.5万地形图(54系)(E-49-003)',type: '1:2.5万地形图'};
//$("#myGrid").jqGrid("addRowData", $("#myGrid").cursor, dataRow, "first");
grid.addRowData(grid.cursor, dataRow1);
grid.addRowData(grid.cursor, dataRow2);
grid.addRowData(grid.cursor, dataRow3);
$("#CreatNewElements").dialog("open");
}