Default calendar goes from filter on using callbackColumn

@johnny
I have a date field where I just want to display Date and month without Year. For this I am using callbackColumn to display only date and month.

Problem with this one is the default calendar that comes in filter that goes away. Is this a bug or done knowingly?

Hello @kapilchugh ,

Unfortunately there isn’t much that you can do here. I’ve tried multiple work-arounds but nothing works. Since this is a common issue with callbackColumn, I will try to fix that for the next version. It will be a tough one and I hope I will not have a big restriction from the architecture of the library (in the frontend).

Reason why this is happening: Unfortunately this is a restriction that comes from the architecture that I have in Grocery CRUD that we can have only one field type per field. Whenever we are using a callback, we are basically changing the field type to a type ‘callbackBackend’. That’s the reason that I’ve created fieldTypeX (for example fieldTypeAddForm which changes only the field type of add form) is to change only the fieldType for a specific state. Now for callbackColumn specifically I will try to bypass this rule (it will not be that straight forward but it is worth the small refactoring that may need) since the expectations are different when it comes to callbackColumn.

I will keep you updated on this one.

Regards
Johnny

Hello @kapilchugh ,

I am glad to inform you that at the latest version (3.1.8) we now have available the function fieldTypeSearchColumn which solves the issue that you have. There is an example at the documentation as well: fieldTypeSearchColumn - Grocery CRUD - A PHP CRUD Generator Library

Hope this helps.

Regards
Johnny

Hi @johnny
Thanks a lot for this. I really appreciate it.

While I was trying it , I found a bug where I am using the Date type and once I click next or previous, it shows distorted UI. Please refer to attached screenshot.
Cal

Hello @kapilchugh and thank you for pointing that out. I haven’t noticed this issue before :slight_smile: . I’ve just fixed it since the issue was that it had outdated CSS for the react-datepicker component. This will be fixed at the next version 3.1.9.

In the meantime, as a workaround, you can resolve the issue by updating the react-datepicker.min.css file, which is outdated.

If you’re using the Codeigniter 4 version, you can find this file under:

public/vendor/grocery-crud/css/react-datepicker/

To fix the UI issue, download the latest version of react-datepicker.min.css from this link (I’ve just added it as a gist) and replace the old file.

Also don’t forget to clear your browser cache to see the change. Let me know if that worked for you.

Regards
Johnny

Hello @kapilchugh

I am glad to inform you that this is now fixed at the latest version 3.1.9 which was released today :slight_smile:

Enjoy
Johnny