Closed andresulivam closed 6 years ago
Yes, you need to modify the built-in partials for that rake datagrid:copy_partials
. Then modify _form.html.erb
partial and access options with filter.options[:html_options]
. In this way you can add any custom options to filter.
Hello, bogdan! Is there a way to add html attributes on the datagrid generated inputs? Like a "placeholder" for example.
Run rake datagrid:copy_partials
. Change _form.html.erb
:
- <%= f.datagrid_filter filter %>
+ <%= f.datagrid_filter filter, placeholder: filter.options[:placeholder] %>
Now you can use :placeholder
option in filter definition:
filter(:value, :string, placeholder: "Specify Value")
Thank you so much! It worked :)
Thank you, Bogdan!
Hi! How to add html options to filters? I tried a some tags like: html_options: {} html_attributes: {} html: {} Can I do this?