JS easyui-datagrid

本地数据格式为:

var data = {'total':4,'rows':[{"student_id":"1234567",
                "student_name":"李丽",
                "student_idcard":"654221199008010102",
                "learn_level":"0",  //学习阶段
                "arrearage":"0",    //欠费
                "item_id":"001",    //资费id
                "item_name":"报名费",  //资费项目
                "count":"16",        //使用量
                "unit":"hour",       //单位
                "study_hour":"16",    //学时
                "application_type":"0",  //申请类型 0代表初次申请,1代表增驾申请
                "islocal":"0",        //是否本地
                "regular_score":"8",  //平时表现
                "test_value":"95",    //测试成绩
                "file_no":"2016070701",   //档案号
                "wechatnum":"zxc123456",  //微信号
                "date":"2016-06-20 44:43:45",
                "user":"王刚"}]} //操作员

在function中,通过

$(function(){
         $obj=$("#id").datagrid({
                        title:'考试报名信息',
            iconCls: 'icon-a_detail', //图标
            fit: true, //datagrid自适应宽度
            height : 'auto',
            striped : true,
            fitColumns:true,
            nowrap : false,
            border : false,
            idField: 'student_id', //主键
            columns : [ [ 
                            {field:'student_id',title:'学生ID' ,"80"} //数据显示
                        ] ]
                        });
                        });
                    $('#id').datagrid('loadData',data);//将数据加载到id中

PS:datagrid加载数据为json数组

原文地址:https://www.cnblogs.com/bycainiao/p/5653082.html