Selecting/Deselecting rows by Ajax in TableTools
Selecting/Deselecting rows by Ajax in TableTools
I have a basic implementation of DataTables with TableTools set to operating system style row selection. I would like to (a) populate the array of selected rows on page load and (b) update a similar array on the server-side by Ajax whenever a click, shift-click, or control-click event occurs.
I am working with a Python-Flask framework and generating the table by passing my table data through a template to the HTML, as follows:
{% for row in rows %}
<tr class="{{ row['state'] }}"> // The CSS class indicates whether the row should be selected on load
<td>{{ row["label"] }}</td>
<td>{{ row["class"] }}</td>
<td>{{ row["source"] }}</td>
</tr>
{% endfor %}
Then I am letting DataTables generate the table from the HTML.I am not sure if I'm just not finding the right section of the API, or if this method or TableTools itself is not appropriate for this kind of functionality I am seeking.
Any pointers would be much appreciated.