problem filtering with columnFilter

problem filtering with columnFilter

MatthewreedMatthewreed Posts: 9Questions: 1Answers: 0
edited July 2013 in Plug-ins
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?

Replies

  • mca87mca87 Posts: 5Questions: 0Answers: 0
    So you're using bServerSide=true to get your data, and you want to filter it locally on the client machine (like serverSide=false) after having receiving everything.
    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)
  • MatthewreedMatthewreed Posts: 9Questions: 1Answers: 0
    To be honest no, I'm using ajax as my data source and set bServerSide = false in that my data set is not too large so I'm able to manage it clientside.

    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.
This discussion has been closed.