django-el-pagination icon indicating copy to clipboard operation
django-el-pagination copied to clipboard

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

Open rightx2 opened this issue 7 years ago • 5 comments

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..

rightx2 avatar Apr 06 '17 11:04 rightx2

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

af3ld avatar Apr 06 '17 18:04 af3ld

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

L-Henke avatar Apr 11 '17 07:04 L-Henke

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

hungphamvn avatar Jul 08 '17 14:07 hungphamvn

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.

shtalinberg avatar Jan 29 '18 13:01 shtalinberg

@shtalinberg check it please #151

aropan avatar Mar 07 '21 16:03 aropan