checkbox to select all options in searchPanes
checkbox to select all options in searchPanes
Khalid Teli
Posts: 251Questions: 71Answers: 0
Hi,
I was just finding a ways to see if we can use check boxes inside searchpanes to filter data, and I came across this example by @colin live.datatables.net/jayilaqa/1/edit , I was wondering if we can have a checkbox at top of each pane to select all option?
I know by default everything is selected, just to make it easy for the users I want to have the selectAll checkbox.
Thank you
Answers
Hi @Khalid Teli ,
That's not something that is supported as standard within SearchPanes. Your best bet would be to create a button, and then have the action call the
rows().select()
api method on each SearchPane DataTable.I've edited colins example to show this working.
Thanks,
Sandy
Hello @sandy
Thank you. That will do it.
However, if we need to select values from just one pane for example let us say select all rows from position.
Can we do something like this, which will select only rows from that particular pane:
Thanks
Hi @Khalid Teli ,
Not quite - that class is to indicate the layout of the panes rather than their index. You would be better to do something like in this example.
Thanks,
Sandy
Sandy, that works very well, but only for column 1 (Position).
If I change your code to
(literally only changing eq(1) to eq(2)), I would expect it to select all options for the next column (Office), but nothing happens.
How do I get it to work?
Simone