yajra / laravel-datatables-editor

Laravel DataTables Editor Integration.
https://yajrabox.com/docs/laravel-datatables/editor-installation
MIT License
114 stars 15 forks source link

Disable Global Search for only specific columns #32

Closed Caine85 closed 5 years ago

Caine85 commented 5 years ago

Hi! First of all, thank you so much for this exceptional package!

In a table of my database, I have encrypted columns along with columns in cleartext. I have created custom search filters with the filterColumn() function for encrypted columns, while I use the global search for those in cleartext.

I would need that global search not to be active in encrypted fields, is there a way to do it? In fact, now I have many false positives in my results, especially for searches of few letters.

To better explain what is my problem, here is an example:

Users Table

User 1
Name (not encrypted): Jhon
Tax_Code (encrypted): eyJpdiI6IisxN2FqSnVMWU9WeFUwRVBQejYzMXc9PSIsInZhbHVlIjoiaSt5eGpPeVNWV3VhVHNPWVJJdCtMS1VKdUwzUFVFOEJpczBEdXlvQitVVGY2amErV2MxWCtKRFwvaE1FbjlLTDMiLCJtYWMiOiIyNmIzNjgwMjU4YmQ2NzMzM2JmNjgwYmU3YWI3YjA1M2M0YWNkMDQ5N2U0NzA3ZDMzZjU1MTFlMjhjOTg0MjYyIn0=

User 2
Name (not encrypted): Max
Tax_Code (encrypted): eyJpdiI6IllvYVVcL1dabjJhoEWlwvQUExcnJhc0ZMUT09IiwidmFsdWUiOiJSU1dPeGFodVV5QWJPdFA2d2dIbzNOUTRYSHdPWW1keGRDVHZvWldVUmpwZ2JhTUxZOFZPVWJjV1k0RVdVenArIiwibWFjIjoiMzgwZGU0Yzg5ODEzYjRhMDcyMjQ4NGEyMzgwYjc2ZTNDY0NDFlOGI5MmZkYmU3YzVlZjlmNTU2ZTc0NzQzYyJ9

If I search for the jho value, I would get both users as a result, even if in fact User 2 would not make sense that returns within the results.

Thanks a lot!

System details

Caine85 commented 5 years ago

I'm sorry, I posted in a wrong place.