gridmanager使用于本地数据,使用function来模拟返回后端数据。

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
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值