Filter to .select row
Filter to .select row
rick63
Posts: 3Questions: 1Answers: 0
Hi,
for me i the first steps in this environment
Then i'm sorry for follow question but I don't find a resolution for me.
1) How can I hide the rows non selected with the use of the click button ?
2) How can back to see all rows ?
In attached you find a little example.
Thank you for feedback.
Bye
Riccardo.
This question has an accepted answers - jump to answer
Answers
See this thread asking a similar question.
Kevin
Thank you Kevin,
I saw the thread but don't clear how to applicate the hidden value on the row don't select.
I wanted to loop over the table and hide the unselected rows.
Then in the loop understand if the row is not selected and then hide it.
Do you have any suggestions?
Riccardo
You can't hide rows from the table, only remove them. The only way I can think of doing that is to have a hidden field in the table which you populate with
select
and depopulate withdeselect
, and when your button is pressed apply a column search withcolumn().search()
on that string. That should work, though not particularly elegant,Colin
Here is one option with the search plugin:
http://live.datatables.net/nivenixu/1/edit
It uses
$.fn.dataTable.Api()
to get an API instance as described here. It usesrow().node()
with theindex
parameter to get thetr
of the row. Then uses jquery hasClass() to see if the row has theselected
class. Displays the row if it does or filters out the row if it does not.Kevin
Nice, that's better than my suggestion!
Colin
Great kthorngren!
This is the solution I was looking for
Thank you.
Thank you also Colin for your answer.
I wish you all a good continuation.
Riccardo.
Do you know how to close this discussion ?