Closed bartoszkopinski closed 8 months ago
Previously, I didn't interoduce new filter types in case when the difference from existing one is only in the UI. Example filter(:categories, :enum, checkboxes: true)
. I believe we should follow this policy this time too and introduce an option to string
filter.
However, I think the option you are going to introduce will be pretty rare. If there is an adequate way how we can make datagrid configurable to introduce such an option, that would be a better approach. I would also want to think of it for some time before merging anything.
@bogdan This filter is a bit different at the moment since it does not include RangedFilter
but I can also see it having additional logic in the future. In general textareas behave a bit differently from inputs (eg. different html options, newlines).
This seems a bit cleaner but I don't mind either way.
In the end, I decided to support {input_options: {type: 'textarea'}
as a way to convert <input type="text"/>
to <textarea/>
. I believe this is better way of doing things as it is only related to interface. Please try it out with v1.8.0 and let me know if it works for you.
https://github.com/bogdan/datagrid/blob/master/Readme.markdown#filters already mentions text filters, but I couldn't find it so I added them.