Advice needed how to use "live" checkboxes with datatables ($.fn.dataTableExt.afnFiltering, fnDraw?)

Advice needed how to use "live" checkboxes with datatables ($.fn.dataTableExt.afnFiltering, fnDraw?)

DaPikkDaPikk Posts: 2Questions: 0Answers: 0
edited March 2013 in DataTables 1.9
Hi,

I'm discovering datatables and novice to javascript and DOM.
Currently i face problem where I need to modify datatable onthefly and how it renders (draws) page.
I have couple of checkboxes which when selected should enable/disable columns and couple of scrolldowns that should use search.
Sample is shown in: http://live.datatables.net/esufaw/edit#javascript,html

First I thought that I should use $.fn.dataTableExt.afnFiltering - but with that I got only partly solution and not the full one.

Can anybody help/point me in the right direction?
(I found that http://live.datatables.net/oyinin/3/edit#preview is somewhat useful for me?)

What and how would be best.

Also - multiple column/row filter is needed - for this I did not find any solution :S
Br,
KT.

Replies

  • allanallan Posts: 63,389Questions: 1Answers: 10,449 Site admin
    I presume the checkboxes are for column visibility? If so, then you want to use fnSetColumnVis with them.

    For the `select` elements, I think you probably want to use fnFilter in this case. There is an example here: http://datatables.net/release-datatables/examples/api/multi_filter_select.html . You'll need to modify that to match what you want of course, but it shows how fnFilter can be used on a single column.

    Allan
  • DaPikkDaPikk Posts: 2Questions: 0Answers: 0
    Hi,

    Thank you for info - however those select boxes cannot be inside datatable container. Those are automatically generated by php from database and are residing elsewhere on page. so principally multi_filter_select does not help me much?!

    I have found how to use that on one search string but not how to use it on multiple search criteria :S

    Br,
    KT.
This discussion has been closed.