how to filter on default columns?
Created 8 years ago by emergingdznsSo in my module, I want to add filters using the $filters variable in the Table Builder functionality. I can add filters for all stream added fields. However I can't seem to add them for the ID, created_at, created_by columns etc. The default fields always result in an error.
In an ideal world, I'd like the "id" filter to allow integers only. The "created_at" filter would be a date selector (even better a between x/y dates selector). The created_by would be a drop-down of users by name or at the very least, a text entry that would filter user profiles based on the entered text.
Any ideas? Possibilities?
You can use base filters instead of field filters.
For searching: https://github.com/anomalylabs/streams-platform/blob/master/src/Field/Table/FieldTableBuilder.php#L43
Note this is very close to field searching but it uses
columns
instead offields
.For basic filters: https://github.com/anomalylabs/streams-platform/blob/master/src/Ui/Table/Component/Filter/FilterRegistry.php
There is also a generic
select
input filter. Check it out!