Quick filtering inconsistent behavior

I’ve noticed that quick filtering INT (or BIGINT) columns behaves differently than quick filtering CHAR (or VARCHAR) and other types (like FLOAT).

It seems to me that GCE uses WHERE col LIKE '%val%' for filtering CHAR, VARCHAR, FLOAT and other types and WHERE col = val for INT/BIGINT, DECIMAL and possibly other types.

Wouldn’t it be a good idea to maintain uniformity across all quick search filtering, regardless of the type of the field/column? I don’t know if every DBMS supports using the LIKE operator for every data type, but I think mysql/mariadb does…

I understand that for many things using the ‘equal’ operator with INT fields makes more sense. The problem is that many of us is using BIGINT for codes or small UUIDs and filtering using ‘like’ operator makes more sense.

I also understand that we can have many filtering options/operators in the filter modal window. But is it possible to customize the behaviour of the quick filtering per column/field?

Thanks in advance!

Hello @bgeneto ,

When we are dealing with numbers it is more rare to search by LIKE. In case you would like to do so you can simply change the field type only for the datagrid to treat it as a string. For example:

$crud->fieldTypeColumn('your_field_name', 'string');
1 Like

Thanks Johnny, but fieldTypeColumn method didn’t work for me, but the fieldType did the (quick filter) trick I need.

$crud->fieldType('your_field_name', 'string');

Nice one, glad that it worked for you :slight_smile: