Applying filters via a plug-in on initialization
Applying filters via a plug-in on initialization
I just wrote a custom sorting plugin that applies sorts on initialization, and life was good. I want to do the same thing with filtering, but I can't seem to find any setting in oSettings that would give me access to filtering. I understand that I can do exactly what I want with the following code:
[code]
var oTable = $('table').dataTable();
foreach(sortingColumn)
oTable.fnFilter(sortingColumn.value, index)
[/code]
But I would much rather do it with a plugin to keep it consistent with all the other custom plugins I'm writing. But it looks like only oSettings gets passed into my function...and I can't call fnFilter on that. Is there any way to do it how I want, or should I just bite the bullet and use the method outlined above?
[code]
var oTable = $('table').dataTable();
foreach(sortingColumn)
oTable.fnFilter(sortingColumn.value, index)
[/code]
But I would much rather do it with a plugin to keep it consistent with all the other custom plugins I'm writing. But it looks like only oSettings gets passed into my function...and I can't call fnFilter on that. Is there any way to do it how I want, or should I just bite the bullet and use the method outlined above?
This discussion has been closed.