EloquentStudio / filter.js

Complete solution for client side filtering and rendering using JSON data
http://eloquentstudio.github.io/filter.js
MIT License
665 stars 182 forks source link

Can I trigger a filter programatically with jquery like $("#filterid").val("bla").change() ? #154

Open raguchi opened 7 years ago

raguchi commented 7 years ago

I'm trying to change a filter values programatically with jquery with $("#filterid").val("new value").change() but it's not working, FJS doesn't realise about the new value, only interacting directly with the filter provoques filtering.

It works in auto demo (try in console with $("#searchbox").val("the go").change(); ), but my code is the normal version, no auto.

How can I achieve this? thanks!

jiren commented 7 years ago

$("#filterid").trigger('change') will work. It also depend upon events: change, click etc

i.e $('#runtime_filter').val('50-100').trigger('change')