First off, I'm not a web developer. I'm just trying to write a simple web app for myself and I decided to do it in Django because I am very comfortable with Python. So I don't really know more than the basics of javascript.
Anyway, my main page is essentially a table using the django-tables2 library on the left side of the screen and a graph using the chart.js library on the right. I've got the skeletons of both of these up.
But now I cannot figure out to add click events to the rows in my table. What I'd like to do is have the graph updated whenever I click on a row in the table. All of the stuff I can find on it (for example: Adding an onclick event to a table row) has me going through things like table ids. But I don't know that there is a table id defined for this table. Because I'm using django-tables2, really the only lines I have specifically creating the table are
{% load render_table from django_tables2 %}
{% render_table table %}
The view I'm using looks something like
class RaceListView(SingleTableView):
model = Race
table_class = RaceTable
template_name = 'prediction.html'
I'm not sure if this code helps at all or if there is some other code you need from me, so just ask if there is something that would make it easier to see what I'm doing. It's kind of difficult in Django though because things connect to each other all over the place.
If anyone has a simple example of how to add click events to tables like this handy, that would be rad. Thanks.