Pagination when using LinkColumn in django-tables2

130 views Asked by At

I'm using a paginated table in my app and the pagination part works great. The table contains Ticket Id and Title of a ticket. I want the Id column to point to a ticket details page. It all works great, but when i click the Ticket Id the page loads without the page query string parameter and my pagination is back on page one.

Is it possible to perserve or add the page query parameter when using LinkColumn? Do I have to build a custom table template for this?

urls.py

url(r'^(?P<ticket_id>C[0-9]+)/$', views.ticket_view, name='ticket_view'),

tables.py

class TicketsTable(tables.Table):
  class Meta:
    model = IssueTicket
    fields = ('ticket_id', 'title', 'status', 'target_date')
    attrs = {'class': 'table table-bordered table-hover'}

  ticket_id = tables.LinkColumn('IssueTracker:ticket_view', args=[A('ticket_id')])
  title = tables.Column()
  status = tables.Column(accessor='get_status_display')
  target_date = tables.Column()

The result with missing query parameter

<a href="/IssueManagement/C000012/">C000012</a>
0

There are 0 answers