Is it possible to use custom filters with a datatable loaded from server-side?

Is it possible to use custom filters with a datatable loaded from server-side?

ArtuvazroArtuvazro Posts: 11Questions: 5Answers: 0
edited January 2016 in Free community support

I've been reading through the documentation but I couldn't find an aswer to this.

I have a table with 5 columns and one of them has display:none (is hidden from public view). I want to use this hidden column for filtering. For instance, I would like to make a function that hides all rows that do not contain in that that column the word "libro". I've tried with all I could find in the API reference, but I wasn't successful.

However, I believe this can be done, because if I use the default search input box of datatables, I can write "libro" there and it only shows the rows that contain that word in that hidden column. So that's why I think it has to be possible to make a function that achieves something similar to that... But I don't know exactly where to start looking.

I'm using this script: http://datatables.net/development/server-side/php_mysql

My datatable can be checked here: http://localizacomopuedas.es/2.0/

I've been looking for more information and I've found this:
https://datatables.net/examples/api/multi_filter_select.html

What I'd like is exactly the same function that those select boxes have (for example, the one that lets you select a city).

Thank you very much.

Answers

  • ArtuvazroArtuvazro Posts: 11Questions: 5Answers: 0
    edited January 2016

    Ok, after some doing more search I found that this was dead easy...

        table
        .column( 4 )
        .search( "libro" )
        .draw();
    

    Sorry for asking such a stupid question :S

This discussion has been closed.