I have a dataTable that is populated without issue when the page loads. Very slick. Love clicking the column names to sort.
The wrinkle is... the user can specify a different date range, and I'd like to repopulate the dataTable at that point. I call the same function as when the page loads and attempt to repopulate the dataTable object. I am learning it is not so easy to blow away and reload the dataTable. I am doing this in PowerChart so I don't have a public facing page that I can show you. However, I'd be glad to provide additional code or information that may be helpful.
HTML:
NOTE: The #documents table populates fine (on the initial load of the page) without the THEAD and TBODY tags, if that is a clue to my puzzle.
.JS FILE:
Currently I don't get an error but the dataTable does not repopulate.
Setting bServerSide to True put me in an endless loop ("DataTables warning: JSON data from server failed to load or be parsed. This is most likely to be caused by a JSON formatting error")
I am using jquery.dataTables.min.js version 1.8.1. I was hoping that setting bDestroy to True would put me on the right path but this is still vexing me. Thank you for any ideas.
The wrinkle is... the user can specify a different date range, and I'd like to repopulate the dataTable at that point. I call the same function as when the page loads and attempt to repopulate the dataTable object. I am learning it is not so easy to blow away and reload the dataTable. I am doing this in PowerChart so I don't have a public facing page that I can show you. However, I'd be glad to provide additional code or information that may be helpful.
HTML:
<TABLE id='documents'> <THEAD> <tr> <th>Event ID</th> <th>Date</th> <th>Subject</th> <th>Result</th> </tr> </THEAD> <TBODY> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </TBODY> </TABLE>
NOTE: The #documents table populates fine (on the initial load of the page) without the THEAD and TBODY tags, if that is a clue to my puzzle.
.JS FILE:
var oTable = $('#documents').dataTable({ "aoColumns": [ { "sTitle": "EventID", "bVisible": false }, { "sTitle": "Date", "sWidth": "110px", "bSortable": true }, { "sTitle": "Subject", "sWidth": "270px", "bSortable": true }, { "sTitle": "Result", "sWidth": "100px", "bSortable": true }], "bRetrieve": true, "bProcessing": true, "bDestroy": true, "bPaginate": false, "bAutoWidth": false, "bFilter": false, "bInfo": false, "aaSorting": [[1, 'desc']], "bJQueryUI": false });
Currently I don't get an error but the dataTable does not repopulate.
Setting bServerSide to True put me in an endless loop ("DataTables warning: JSON data from server failed to load or be parsed. This is most likely to be caused by a JSON formatting error")
I am using jquery.dataTables.min.js version 1.8.1. I was hoping that setting bDestroy to True would put me on the right path but this is still vexing me. Thank you for any ideas.