How to keep a few rows out of search ?
How to keep a few rows out of search ?
jainankit0312
Posts: 22Questions: 1Answers: 0
Hi,
When using search, I want a few rows to remain visible even though they don't fulfill the search criteria.
How can I achieve this ?
I read about "$.fn.dataTableExt.afnFiltering" but couldn't get it completely.
Can someone share a piece of code or point me to a useful link.
Regards,
Ankit
When using search, I want a few rows to remain visible even though they don't fulfill the search criteria.
How can I achieve this ?
I read about "$.fn.dataTableExt.afnFiltering" but couldn't get it completely.
Can someone share a piece of code or point me to a useful link.
Regards,
Ankit
This discussion has been closed.
Replies
I don't understand, because how can I know (and - more importantly - how can DataTables know) which rows those are?
P.S. You found this one as well? http://www.datatables.net/examples/plug-ins/range_filtering.html
Thanks for showing interest.
When I add rows, I apply a different CSS to a few of them.
While searching can I omit those particular rows from getting filtered. I can also provide the index of the rows, if required.
The link you provided is not a global filter. I will be in need to define the filter for each column.
Regards,
Ankit
When you use Row Grouping, the group title remains in the search if any row content matches with the filter criteria.
How ?
Regards,
Ankit
An example of a different search function is: http://datatables.net/plug-ins/api#fnFindCellRowNodes. You could adapt this function, so it will look to the 'class' of the / being searched.
I got a way of keeping a few rows out of search.
There is a function _fnFilter in the JS file. It basically returns a 'stack' which has the row index of rows those will be displayed after search.
So, if you want a few rows to remain visible after search, just push the row index. oSettings.aiDisplay.push(rowIndex);
Regards,
Ankit Jain