column().search() result
column().search() result

Is it possible to know if column().search() returns true ( data is found matching) or false (data is not found).
This discussion has been closed.
Is it possible to know if column().search() returns true ( data is found matching) or false (data is not found).
Answers
You could use the
rows()
method withany()
to find this out:That would return
true
if there are results,false
if not.Allan
Hi Allan, thanks for reply.
I have this code:
var oTable6 = $('#relations').DataTable();
var select = oTable6
.column( 0 ).search( '^'+inv+'$', true, false )
.column( 1 ).search( '^'+yl+'$', true, false ).any();
if( select == true)
// something
This does not work properly,select always is true
Any idea about it?
now I tried the following code and works fine
var select = oTable6
.column( 0 ).search( '^'+inv+'$', true, false )
.column( 1 ).search( '^'+yl+'$', true, false );
var info = select.page.info();
if( info.recordsDisplay>0)
$('.active')[index].checked = true;
I'll need to
draw()
the table before the new search terms take effect.Allan