function m(settings, params) {}
参数里包含了基础配置和分页排序信息。
注意:尾页使用此形式则不生效,需要将尾页按钮隐藏。
官网案例调整(直接copy到光网的在线编辑器中查看效果):
document.querySelector('#table-demo-baseCode').GM({
gridManagerName: 'demo-baseCode',
ajaxData: function m(settings, params) {
// 传入参数信息
var dataIn = [{ "id": 71, "name": "浏览器的工作原理", "info": "浏览器的工作原理:新式网络浏览器幕后揭秘", "url": "https://www.html5rocks.com/zh/tutorials/internals/howbrowserswork/#The_browsers_we_will_talk_about", "type": 5, "status": 1, "createDate": 1487310574288, "lastDate": 1487310574288 }, { "id": 70, "name": "esLint官网", "info": "查询esLint 文档", "url": "http://eslint.org/", "type": 5, "status": 1, "createDate": 1480300349521, "lastDate": 1480300349521 }, { "id": 69, "name": "前端浏览器支持查询", "info": "html5,css,js支持查询", "url": "http://caniuse.com/", "type": 5, "status": 1, "createDate": 1480147232990, "lastDate": 1486738826092 }, { "id": 68, "name": "Antv", "info": "数据可视化图表", "url": "https://antv.alipay.com/chart/index.html", "type": 5, "status": 1, "createDate": 1479880390329, "lastDate": 1479880390329 }, { "id": 67, "name": "Homebrew", "info": "mac os 软件安装工具", "url": "http://brew.sh/", "type": 5, "status": 1, "createDate": 1479880320090, "lastDate": 1479880320090 }, { "id": 66, "name": "ECMAScript支持查询", "info": "ECMAScript浏览器支持情况", "url": "http://kangax.github.io/compat-table/es6/", "type": 5, "status": 1, "createDate": 1479461022897, "lastDate": 1480297081932 }, { "id": 65, "name": "angularjs", "info": "AngularJS 实例", "url": "http://www.runoob.com/angularjs/angularjs-tutorial.html", "type": 1, "status": 1, "createDate": 1466478691507, "lastDate": 1466478691507 }, { "id": 64, "name": "angluarjs", "info": "", "url": "http://www.apjs.net/", "type": 6, "status": 1, "createDate": 1456201719137, "lastDate": 1456201719137 }, { "id": 63, "name": "RequireJS和AMD规范", "info": "", "url": "http://javascript.ruanyifeng.com/tool/requirejs.html", "type": 6, "status": 1, "createDate": 1456201687085, "lastDate": 1524901152938 }, { "id": 62, "name": "产品集", "info": "", "url": "http://next.36kr.com/posts/collections", "type": 6, "status": 1, "createDate": 1456201643565, "lastDate": 1456201666264 }, { "id": 60, "name": "音乐播放器 跳屏特效", "info": "", "url": "http://wayou.github.io/MeowmeowPlayer/", "type": 6, "status": 1, "createDate": 1456201608041, "lastDate": 1456201608041 }, { "id": 59, "name": "阿里云:酷站代码", "info": "", "url": "http://www.5icool.org/wangyetexiao/", "type": 6, "status": 1, "createDate": 145620