4

I want my django_tables2 table to be able to add new rows at the top as new data comes in from the server (possibly by polling, or possibly via a push). I don't want to do a server page refresh, just scroll the existing rows down and add the new rows at the top.

I know I can just set up a periodic refresh from the server but that's not what I want to do.

Is this possible? After much searching, I have not found any reference to doing this.

Thanks.

Carilda
  • 161
  • 2
  • 12

2 Answers2

1

Django-tables2 is a great tool, but it is built around a classical notion of doing everything on the server side. If you find yourself reaching out to band-aiding custom ajaxy solutions on top of it, I would recommend you to look into going with django-eztables instead.

This library effectively gives you out-of-the-box integration with jQuery DataTables, which is a rock-solid framework.

After installing eztables you'll instantly be able to update table data without refreshing the whole page and also keep the user-selected filtering an sorting (and easily do much, much more). I personally use eztables, they are quite modern, but nevertheless well-tested and robust.

Community
  • 1
  • 1
Ivan Kharlamov
  • 1,889
  • 2
  • 24
  • 33
  • I agree with the django-eztables approach. Also, another alternative is https://github.com/pivotal-energy-solutions/django-datatable-view which is another way to integrate datatables with django. – Serafeim Dec 27 '13 at 06:29
  • @Serafeim, thanks for suggestion! I'll definitely take a look at this one! – Ivan Kharlamov Dec 27 '13 at 08:41
0

Best solution would be, I think, SlickGrid. Just add your data from an ajax request,

Below the Radar
  • 7,321
  • 11
  • 63
  • 142