Searching Empty String in Column
Searching Empty String in Column
shivampaw
Posts: 1Questions: 1Answers: 0
Hi,
I am trying to search for an empty string like this:
oTable.columns([clientfirst, clientsecond, clientthird]).search( '^$', true, false ).draw();
Where clientfirst, clientsecond, clientthird are indexes.
However the table is showing all rows.
Is this because I need it to make sure all the rows are blank and not just one of them?
In the table example I have clientfirst and clientthird blank but clientsecond isn't.
How can I fix this?
Thanks
This discussion has been closed.
Answers
I am also looking for a way to search for cells that are empty.
The problem with this search is that Datatables performs an
and
search through each column of the row. If only one column were listed above then search would work. However if you want to search the full table then a custom search API is needed to execute the search usingor
.Here is an example:
http://live.datatables.net/xawixeha/1/edit
Setting
blankCells
to false will return all rows. Setting it true will return rows with blank cells. The table has 6 columns. I put one blank in each column on 6 different rows. WhenblankCells
is true the table will display those 6 rows.Kevin