KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

DataTables Search Bar #2565

Open Andre Van Der Walt opened this topic on on Feb 9, 2022 - 8 comments

Andre Van Der Walt commented on Feb 9, 2022

Good day

Previously spaces did not make any difference in the search bar above tables.

With Ver 2 and up, entering a string with a space does not find the text entered.

Andre Van Der Walt commented on Feb 9, 2022

Sebastian Morales commented on Feb 9, 2022

Pls kindly give a specific example so that we can replicate it and find a solution for you. Tks,

Andre Van Der Walt commented on Feb 9, 2022

Andre Van Der Walt commented on Feb 9, 2022

Andre Van Der Walt commented on Feb 9, 2022

Andre Van Der Walt commented on Feb 9, 2022

1st Image shows Test in table 2nd Image shows text with space not finding value in image 1 3rd image shows the search finding the text in image 1 if the text does not include a space

Sebastian Morales commented on Feb 9, 2022

I see it. With newer versions of DataTables we have a property called searchMode which can be "default", "and", "or", "exact" or any combination of those values ("and|exact", etc):

https://www.koolreport.com/docs/datagrid/datatables/#custom-attributes-searchmode-(%22or%22-since-version-%3E=-3.0.0,-%22and|exact%22-since-version-6.0.0)

<?php 
DataTables::create(array(
    ...
    "searchMode" => "or|and", //"and|exact", "or|and|exact", "exact|or"

With default search mode, to search for a phrase with blank space in them you can include the phrase inside double quote like "sales manager". If you don't want to use double quote, you can set "searchMode" => "exact".

Andre Van Der Walt commented on Feb 9, 2022

Appreciate it.

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
bug
solved

Dashboard