Closed hxhac closed 5 years ago
有一个不是很懂的点,这个重写的paginate()方法是Builder下的那个paginate()吗,那个paginate()应该是一个静态方法,带了一堆参数吧;我怀疑是我重写错方法了;
$grid->disablePagination() 看看是不是禁用了
$grid->disablePagination() 看看是不是禁用了
查了一下,没有禁用这个;所以很头疼,刚刚一直在翻Grid这块的源码,感觉不太应该啊; @454335025
必须要指定走paginate()方法,才能打印出来对应的数据;直接new StatsDaily,paginate()不生效;
这不是正常现象吗?
那调用的那边应该怎么写呢? @z-song
$grid->disablePagination() 看看是不是禁用了
查了一下,没有禁用这个;所以很头疼,刚刚一直在翻Grid这块的源码,感觉不太应该啊; @454335025
我都xdebug了两天了,如果是index确实是走paginate,但是filter筛选控件不走那里啊
可以了,多谢,一直很想知道源码怎么看,但是一碰到_call方法就晕,除非是写的很直白的代码能看懂,但是框架的源码都是封装了好几层的,就是这几层带着些什么知识去阅读比较好,有什么技巧吗
------------------ 原始邮件 ------------------ 发件人: "NDDDA"notifications@github.com; 发送时间: 2019年5月20日(星期一) 晚上8:02 收件人: "z-song/laravel-admin"laravel-admin@noreply.github.com; 抄送: "布鲁布鲁"2199374997@qq.com;"Comment"comment@noreply.github.com; 主题: Re: [z-song/laravel-admin] 自定义表格数据源,重写了model的paginate()方法之后,还是展示不出来自定义的数据 (#3370)
1fe75fc 看这个,我刚提交修复的
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Description:
参考文档这块表格数据源,代码直接粘到项目里,但是grid里的模型,没走这个paginate()方法
必须要指定走paginate()方法,才能打印出来对应的数据;直接new StatsDaily,paginate()不生效;
Steps To Reproduce:
这个是我自定义的数据源,用
打印出来的;
直接new StastDaily拿到的数据,并没有走paginate()方法