是否可以使用 django-tables 2 进行无限滚动?

Is it possible to use django-tables 2 with infinte scroll?

我刚开始使用 Django 2 和最新版本的 django-tables2 编写应用程序。到目前为止一切正常,没有任何问题,但现在我有一个问题。我想通过使用粘性 header 和无限滚动来显示一些数据(所以我想向下滚动而不是 table 底部的页面 1,2,3...,N ).

我结合 django-tables2 检查了几页(包括 django-tables2 https://django-tables2.readthedocs.io/en/latest/index.html). But I didn't find any solution which do the trick. I was thinking of using django-endless-pagination(https://django-endless-pagination.readthedocs.io/en/latest/start.html#quickstart 的官方文档),但我什至不确定这是否有效.

所以我的问题是是否可以将无限滚动与 django-tables2 一起使用?

我认为您不能为此使用该逻辑。 django-tables2 是一个有用的插件,它作用于 server-side,当 Django 呈现模板时。

要实现无限滚动,您必须实现一些 javascript,执行请求并在用户 'gets to the bottom' 时动态添加 html。我不会说谎,这并不容易,但很有趣! x)

所以如果其他人正在寻找这个答案是否定的。