shtalinberg / django-el-pagination

Django endless pagination tools. Ajax, multiple and lazy pagination, Twitter-style and Digg-style pagination.
MIT License
307 stars 71 forks source link

Doesn't work inside of html `<table>` element. #75

Open rightx2 opened 7 years ago

rightx2 commented 7 years ago

views.py


from el_pagination.views import AjaxListView

from clien.models import ClienPost

class ClienListView(AjaxListView):
    model = ClienPost
    context_object_name = "posts"
    template_name = "clien/clien_list.html"
    page_template = 'clien/clien_list_page.html'

    def get_queryset(self):
        posts = ClienPost.objects.active()
        return posts

template

{% block content %}
<table class="table table-hover table-expandable table-striped">
    <thead>
      <tr>
        <th> 카테고리 </th>
        <th> 제 목 </th>
        <th> 게시날짜 </th>
        <th> 좋아요 </th>
      </tr>
    </thead>
    <tbody>
      {% include page_template %}
    </tbody>
</table>
{% endblock %}

{% block custom_js %}
    <script src="{% static 'el-pagination/js/el-pagination.js' %}"></script>
    <script>
        $.endlessPaginate({
            paginateOnScroll: true,
            paginateOnScrollChunkSize: 20
        });
    </script>
    {% javascript "clien" %}
{% endblock %}

page_template

{% load el_pagination_tags %}

{% lazy_paginate posts %}

{% for post in posts %}
    <tr>
        <td> {{ post.category }} </td>
        <td> {{ post.title }} </td>
        <td> {{ post.post_date }} </td>
        <td> 좋아요 logo </td>
    </tr>
{% endfor %}

{% show_more %}

It shows more upper side of contents like this:

image

If I clicked more, new contents is loaded "on" the previous posts..

af3ld commented 7 years ago

I am having nearly the exact same issue and both our views and templates are configured nearly identically. When I click the more it inserts an oddly formatted version above the table like so

screen shot 2017-04-06 at 11 00 34 am

I am using Django 1.10.6

L-Henke commented 7 years ago

There was a PR for this in the original django-endless-pagination project for this. Maybe this can be included here. https://github.com/frankban/django-endless-pagination/pull/79

hungphamvn commented 7 years ago

Sorry, How could I implement show_more in table ? (without old version django-endless-pagination)

shtalinberg commented 6 years ago

I can add tag show_more_table (based on PR from old app) to future if anybody make PR with documentation and tests for this future.

aropan commented 3 years ago

@shtalinberg check it please #151