jhund / filterrific

Filterrific is a Rails Engine plugin that makes it easy to filter, search, and sort your ActiveRecord lists.
http://filterrific.clearcove.ca
MIT License
910 stars 125 forks source link

Filterrific listens for changes on every input inside form helper #143

Closed danielsousaio closed 4 years ago

danielsousaio commented 7 years ago

Hello,

I'm working with other inputs inside form_for_filterrific, and your jquery listens for every input event. I believe that should not be the case, instead you could target only inputs that have names starting with filterrific.

Scenario for your thoughts:

Ideas and solutions:

https://github.com/jhund/filterrific/blob/d1d533cbbe88007dc10bbc251db01a0756573db9/app/assets/javascripts/filterrific/filterrific-jquery.js#L85

ddnexus commented 6 years ago

+1 Currently it generates a lot of unwanted AJAX calls if you use it with some other stuff that internally uses input (e.g. selectivity.js). The ":input[name^='filterrific']" is a super simple fix that works.

gioch commented 6 years ago

Any update on this ? Issue was opened Sep 5, 2017.

danielsousaio commented 6 years ago

@jhund would love to close this issue, any thoughts?

cartond commented 5 years ago

You can write your own logic by specifying a different ID like so: = form_for_filterrific @filterrific, { html: { id: 'foobar' } } do |f|

And write your own custom JS