search in regex mode
search in regex mode
Hi,
regex in search is driving me crazy.
I want to make a negative lookahead of a table. That is, search all row which some column is different from 0 (zero).
I'm using DataTables with DataTables Editor to fetch de rows and current latest versions of both (1.10.15)
that is the declaration of the table
tableDetail=$('#data-table-resultat').DataTable( {
"language": {"url": "<?php echo asset_url(); ?>plugins/DataTables/languages/ca_ES.json"},
dom: "lBfrtip",
responsive:true,
processing: true,
ajax: {
url: "ajax/resultatcarro/"+gidGeneracioCarro,
type: "POST"
},
serverSide: true,
columns: [
{ data: "estat" }, // 0
{ data: "incidencia" }, // 1
(...)
{ data: "quantitat"} // 15
],
select: true,
} );
};
I'm trying to get all rows in which column 6 is different from zero. So i do
tableDetail.columns(6).search('^(?!.*0)',true,false ).draw();
and it returns nothing
It seems 'search' is not working in regex mode, no matter what I put in the second and third parameter
Answers
My original answer is not correct... I just noticed that you are using server side processing. Your server side script will need to process the regex search and return the correct rows.
Kevin