Question

this code uses %like% for searching. how can we define to search the exact phrase?

 $c->grid->addQuickSearch(array('status',"name"));

for example if we have (1,12,13) in the grid and we search "1" I want to show just the 1.

Was it helpful?

Solution

copy this class to your project lib

https://github.com/atk4/atk4/blob/master/lib/QuickSearch.php#L99

and change line 116

$or->where($field, 'like', $v);

You can change name on new class and use them both - original and new. To define which QuichSearch you want to use set class name:

$grid->addQuickSearch($fields,'NewQuickSearch');

https://github.com/atk4/atk4/blob/master/lib/Grid/Advanced.php#L129

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top