简体   繁体   English

使用will_paginate在rails中向下滚动分页

[英]Scroll down pagination in rails using will_paginate

I wanna use infinite scroll down pagination in rails and want to pass the information like page number so that next data can be retrieved in the action and for the scroll down i can append the data to the existing data in my view. 我想在rails中使用无限向下滚动分页,并希望传递诸如页码之类的信息,以便可以在动作中检索下一个数据,并且为了向下滚动,我可以将数据附加到我视图中的现有数据。

is there any thing scroll down pagination that we can do with the will_paginate? 是否有任何东西向下滚动分页我们可以用will_paginate做什么?

Thanks in advance --Vam. 在此先感谢--Vam。

这个Jquery插件可以帮助https://github.com/jney/jquery.pageless

to see how to do this yourself, have a look at 看看如何自己做,看看

http://railscasts.com/episodes/174-pagination-with-ajax http://railscasts.com/episodes/174-pagination-with-ajax

to see how to use will_paginate with ajax (jquery). 看看如何使用带有ajax(jquery)的will_paginate。 Ryan shows how to modify the usual will_paginate approach. Ryan演示了如何修改通常的will_paginate方法。 First how to modify the links of the pagination bar and then he shows how to modify the view to display newly loaded objects... In this video he replaces shown items by newly loaded items. 首先,如何修改分页栏的链接,然后他显示如何修改视图以显示新加载的对象...在此视频中,他用新加载的项目替换显示的项目。 You'd just have to tweak the index.js.erb to append them. 你只需要调整index.js.erb来追加它们。

nevertheless ... you might also want to checkout his video 不过......你可能也想看看他的视频

http://railscasts.com/episodes/114-endless-page http://railscasts.com/episodes/114-endless-page

in which he shows what you asked for but without will_pagination 他展示了你所要求的但没有will_pagination

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM