zoukankan      html  css  js  c++  java
  • 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数组

  • 相关阅读:
    ASP.NET WEB API构建基于REST风格
    .net平台下深拷贝和浅拷贝
    Visual Studio 必备神器
    sql注入
    proxy
    职场人生
    JSch
    何时用继承,何时用组合
    视频码率,帧率和分辨率的联系与差别
    超过响应缓冲区限制
  • 原文地址:https://www.cnblogs.com/bycainiao/p/5653082.html
Copyright © 2011-2022 走看看