DataTables with Django
DataTables with Django
Has anyone tried to use DataTables with Django? I could not seem to get it to work, I had everything in the static files, etc..
Once I try and use datatables, I lose all the template styling and it just goes back to a default table.
This is the code:
[code]
{% extends "base.html" %}
{% load static %}
{% block content %}
$(document).ready( function () {
$('#courses').dataTable();
} );
Golf Course
Front 9
Back 9
Total Par
{% for course_name, par_front_9, par_back_9, total_par in data %}
{{ course_name }}
{{ par_front_9 }}
{{ par_back_9 }}
{{ total_par }}
{% endfor %}
{% endblock %}
[/code]
Once I try and use datatables, I lose all the template styling and it just goes back to a default table.
This is the code:
[code]
{% extends "base.html" %}
{% load static %}
{% block content %}
$(document).ready( function () {
$('#courses').dataTable();
} );
Golf Course
Front 9
Back 9
Total Par
{% for course_name, par_front_9, par_back_9, total_par in data %}
{{ course_name }}
{{ par_front_9 }}
{{ par_back_9 }}
{{ total_par }}
{% endfor %}
{% endblock %}
[/code]
This discussion has been closed.