Version 5, last updated by jarrod.neven at September 07, 2010 03:13 UTC
Datatables_demo is a demonstration of the jQuery plug in, datatables with server side datasource from Django. The demonstration contains a working demo Django project complete with HTML, CSS and Javascript needed to implement a complete working same.
This demo is pretty self-explanatory. It uses only basic django configuration and, we believe, can be easily understood by django-beginners.
Django datatables usage:
To implement this code into your application, follow these steps:
- Create an entry in urls.py and views.py that will server the HTML and JS needed for datatables
- Create a separate url and view for returning a json object to datatables.
- create a queryset object for the model you wish the data to be drawn from (querySet)
- create a dict for the column names, in correct display order (columnIndexNameMap)
- return the response to get_datatables_records which is contained in utils.py