datagrid与jqgrid区别

1.datagrid的测试数据:
var obj = {'total':100,'rows':[{'qualityContorlPoint':'机组对中','qualityIndex':'径向偏差0.05mm,轴向偏差0.05mm'},
                              {'qualityContorlPoint':'机组对中','qualityIndex':'径向偏差0.05mm,轴向偏差0.05mm'},
                              {'qualityContorlPoint':'机组对中','qualityIndex':'径向偏差0.05mm,轴向偏差0.05mm'},
                              {'qualityContorlPoint':'机组对中','qualityIndex':'径向偏差0.05mm,轴向偏差0.05mm'},
                              {'qualityContorlPoint':'机组对中','qualityIndex':'径向偏差0.05mm,轴向偏差0.05mm'},
                              {'qualityContorlPoint':'机组对中','qualityIndex':'径向偏差0.05mm,轴向偏差0.05mm'}]};   
$('#EquipmentControlNodeTable').datagrid('loadData',obj);
 
2.datagrid的formatter写法:
{
field : "qualityStandard",
title : "质量控制点",
width : 84,
editor : "text",
formatter : function(value, rowData, rowIndex) {
return value.qualityStandardName;
}
}
图片
3.datagrid清空表格数据:
$("#OverhaulStandardTable").datagrid("loadData", {
rows : []
});
 4.datagrid表格loading:
  $('#searchAddrDg').datagrid('loading');
5.datagrid表格关闭loding:
  $('#searchAddrDg').datagrid('loaded');
 
1.jqgrid的测试数据:
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"} 
               ];
  for ( var i = 0; i <= mydata.length; i++){
    jQuery("#list4").jqGrid('addRowData', i + 1, mydata[i]);
  }
 
2.jqgrid的formatter写法:
formatter : function(cellvalue,options, rowObject) {
return cellvalue.qualityStandardValue;
}
3.jqgrid分页要reload:
$("#OverhaulStandardMaintenanceTable").jqGrid("setGridParam").trigger("reloadGrid");
 4.jqgrid清空表格数据:
$("#OverhaulStandardMaintenanceTable").jqGrid('clearGridData');

5.jqgrid表格数据加载loading打开
$("#OverhaulStandardMaintenanceTable").jqGrid("showErrorMessage", "正在加载");
6.5qgrid表格数据加载loading关闭
$("#OverhaulStandardMaintenanceTable").jqGrid("hideErrorMessage");

posted @ 2017-08-08 14:40  李大娜  阅读(2565)  评论(0编辑  收藏  举报