Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chunk not working #147

Open
miguelwon opened this issue Aug 3, 2020 · 0 comments
Open

Chunk not working #147

miguelwon opened this issue Aug 3, 2020 · 0 comments

Comments

@miguelwon
Copy link

I want to implement Twitter-style pagination but to stop and after N pages, replacing the scroll by a "show more" link that will then start again the scrolling pagination. I'm using the chunk feature but it is not working for me. It keeps the scrolling pagination just like the chunk feature is turned off. This is my code:

view.py:

def dashboard(request):
    template = 'articles/dashboard.html'
    page_template = 'articles/dashboard_page.html'
    if request.is_ajax():
        template = page_template
    context = {
        'section':'dashboard',
        'entries': Article.objects.all().order_by('-publish_date'),
        'page_template': page_template,
    }
    return render(request, template, context)

dashboard.html:


        {% include page_template %}
        {% block js %}
        {{ block.super }}
        <script src="http://code.jquery.com/jquery-latest.js"></script>
        <script src="{% static 'js/el_pagination/el-pagination.js' %}"></script>
        <script>
        $.endlessPaginate({
          paginateOnScroll: true,
          paginateOnScrollChunkSize: 20
        });
        </script>

dashboard_page.html:

{% load el_pagination_tags %}
{% paginate entries %}
    {%for article in entries%}
        ...
    {%endfor%}
{% show_more "mais" "a carregar..." %}

I'm el-pagination version 3.3.0 with Django 3.6.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant