problem filtering with columnFilter
problem filtering with columnFilter
Matthewreed
Posts: 9Questions: 1Answers: 0
Hello, I'm trying to apply a quite complex filter on my datatables, getting server data and apply select and input filters and default (selected) values.
I'd want to get the whole dataset but show only filtered ones and show selected values on filters.
Unfortunately I keep getting a "string undefined error" on _fnInfoMacros every time I add a selected field to columnFilter objects; I think such an error is somwhow related to datatable fnFilter.
Moreover I see that selected option could be setted directly in datatable through oSettings.aoPreSearchCols but I don't find any example about how to set it.
Any hint?
I'd want to get the whole dataset but show only filtered ones and show selected values on filters.
Unfortunately I keep getting a "string undefined error" on _fnInfoMacros every time I add a selected field to columnFilter objects; I think such an error is somwhow related to datatable fnFilter.
Moreover I see that selected option could be setted directly in datatable through oSettings.aoPreSearchCols but I don't find any example about how to set it.
Any hint?
This discussion has been closed.
Replies
Am I understanding it correctly?
If yes, I did something that looks like that, but it requires to edit your columnFilter in a way that it will not request data from the server.
If that's the case it's better for you to use bServerSide=false for simplicity.
If I remember well aoPreSearchCols is more something that you use with bSaveState, it may not be that useful.
(I'd trust more datatables than its plugins, even if I respect the author of columnFilter because it's REALLY useful, there were some little bugs in it, not much but enough to have to fix them. I never encountered one on datatables)
As far as I can see, columnFilter does a call to fnFilter in fnCreateColumnSelect to filter data after it creates select tag, but it triggers an error in datatables _fnInfoMacros function (string is undefined).
Thanks for the info about aoPreSearchCols, I saw it used in columnFilter as an alternative to selected in options object.
Unfortunately I found a couple of bugs related to header building too, I don't understand why fixings are described in the forum but the code is not fixed yet.