I'm using dc.js
to create charts and data table.
I wanted to add some pagination styles and search option in the table.
jQuery Data table script :
$(document).ready(function() {
$('#data-table').DataTable();
})
problem is - i get all the jquery data table options displayed like search box, number of entries. But none of them work.
Some one please help.
Found this post. But nothing useful.
I like to use DynaTable for this - http://www.dynatable.com/
1) Define your table html:
2) Hook in dynatable with your preferred options and the crossfilter dimension:
3) Write a method to refresh the table - dc.events helps to limit the number of times this is called on brush changes:
4) hook this method into each charts filter event:
5) Call Refresh table once to display the current data:
6) Render the DC charts:
Here is a jsfiddle for this: http://jsfiddle.net/djmartin_umich/5jweT/2/
Note that in this fiddle I used the group rather than the dimension to feed the dynatable data.
Since I prefer to use DataTables, I adapted DJ Martin's solution like so:
Set table html:
Set your DataTables options:
Create DataTables instance:
Create RefreshTable function and attach to charts:
Call RefreshTable() once to load initial data, and render all charts: