Reputation: 441
I'm trying to use Django pagination endless and it works perfectly styled Twitter and on a roll. It does not work in style Digg. Unfortunately I need Digg Style in my app. This is my code:
View.py
from endless_pagination.decorators import page_template
@page_template('template_page.html')
def my_view(request, template='template.html', extra_context=None, ord=3):
# some code to setting variable to pass to the template.html
var = 2
var = 1
my_data = my_data.objects.all()
context = {
'my_data':my_data,
'var1': var1,
'var2': var2,
'my_data' : my_data,
}
if extra_context is not None:
context.update(extra_context)
return render_to_response(template, context,
context_instance=RequestContext(request))
template.html
<table>
<tbody>
<div class="endless_page_template">
{% include page_template %}
</div>
</tbody>
</table>
<script src="/static/assets/scripts/endless_pagination/js/endless-pagination.js"></script>
<script>
$(document).ready(function() {
$.endlessPaginate();
});
</script>
template_page.html
{% load endless %}
{% paginate my_data %}
{% for data in my_data %}
...
{% endfor %}
{% get_pages %}
{% if pages.paginated %}
{{ pages }}
{% endif %}
If I click on pages number, nothing happens (no page refresh, no ajax call, etc.). Where is the problem? Thanks a lot. In console nothing happens
Upvotes: 2
Views: 573