列名 以及该列对应的json值
var cols = [ { title:'ID', name:'id' ,width:100, align:'center' }, { title:'用户ID', name:'user_id' ,width:100, align:'center' }, { title:'APPID', name:'app_id' ,width:100, align:'center'}, { title:'来自哪个游戏', name:'from_app_id' ,width:100, align:'center'}, { title:'奖励状态', name:'status' ,width:100, align:'center'}, { title:'时间', name:'dt' ,width:200, align:'center'}, { title:'操作', name:'' ,width:150, align:'center', lockWidth:true, lockDisplay: true, renderer: function(){ return '<button class="btn btn-info">查看</button> <button class="btn btn-danger">删除</button>'} } ];
AJAX请求
var mmg = $('#active-info').mmGrid({ cols: cols, url: 'adwall/activeList', params: {"appid":null,"status":null,"from_app_id":null}, width: 'auto', height: '500px', sortName: 'id',// 更具ID排序 method: 'get', // 请求方式 multiSelect: true,// 多选 checkCol: true, // 选框列 indexCol: true // 索引列 });