Angular datatable fnDraw() doesn't work
Angular datatable fnDraw() doesn't work
I am using datatable lib in an angular directive similar to Ventura suggested http://stackoverflow.com/questions/14242455/using-jquery-datatable-with-angularjs. I have a problem with the fnDraw, in my app I have multiple web pages each have a datatable, since I use angular the page doesn't reload at all. My datatable can still load data on each page, BUT after visited more than one page, then try to call scope.dataTable.fnDraw() to filter my datatable, I got this error:Uncaught TypeError: Cannot read property 'oFeatures' of null
I put some break points in the reDraw function, and found out oSettings(line 5557) is null, in the _fnSettingsFromNode function I can see DataTable.settings[i].nTable === nTable (line 4611) alwasy return false, and I can find DataTable.settings contains multiple datatables but the for loop cannot match with the current one
Any idea?
function _fnSettingsFromNode ( nTable )
{
for ( var i=0 ; i
I put some break points in the reDraw function, and found out oSettings(line 5557) is null, in the _fnSettingsFromNode function I can see DataTable.settings[i].nTable === nTable (line 4611) alwasy return false, and I can find DataTable.settings contains multiple datatables but the for loop cannot match with the current one
Any idea?
function _fnSettingsFromNode ( nTable )
{
for ( var i=0 ; i
This discussion has been closed.
Replies
Allan
It works well before I uses Angular routes, because the page refresh every time, But now the page does not refresh and this error started to occur. This is the html before Datatable and angular applied: https://gist.github.com/jianbo/6740093, and this is after https://gist.github.com/jianbo/6740088, any idea?
Thanks
Its now solved by referencing Datatable through $.fn.dataTableSettings[i].oInstance.fnFilter()
Note to anyone else reading this - this is not supported! At the moment, Angular and DataTables don't appear to play well together.
Allan