Closed mchessl closed 3 years ago
Hello @mchessl , this doesn't seem to be feasible, since for performance reason filtering is always applied at the database level, and here your supplying and arbitrary text expression; the View has no idea that is is the result of concatenating values from different columns. I leave this issue open in case someone (including myself) would suggest a possible alternative solution (maybe playing with get_initial_queryset()). Cheers
Thanks @morlandi for your answer !
@mchessl , you might want to add a sidebar to implement your specific "multi-column" search as explained here:
https://github.com/morlandi/django-ajax-datatable#18add-a-sidebar-with-custom-filters
I'm going to close this issue; feel free to reopen it if you have any suggestion
Ok thanks @morlandi
Hello @morlandi,
Firstly bravo for this project, I am using it and it is so helpful.
I have an issue with filtering a Placeholder column. This column is a concatenation of its value and 3 other columns.
My column is defined as such {'name': 'column_1', 'placeholder': True, 'visible': True, 'searchable': True, 'orderable': False,}, And then def customize_row(self, row, obj): row['column_1'] = "
The filter only works for values issued from column_1, so I guess it is filtering before the row is assigned with my concatenation.
Is there a way I can filter a Placeholder column using its final value ?
Thanks a lot
ps : column_1 / 2/ / 3/ 4 being the different columns of my model