I’m using the jQuery filtering plugin Filtrify and having difficulty adding multiple sub-functions.
It works fine until I try and add two callbacks. Here’s my best attempt!
var ft = $.filtrify("container", "searchbox", {
close : true,
callback : {
function() {
destroyPagination();
setPagination();
},
function() {
if ( mismatch.length ) $("div#reset").show();
else $("div#reset").hide();
}
}
});
I’ve hunted around on Stack Overflow, the Filtrify documentation and elsewhere online and I just can’t find any info or examples with multiple sub-functions like the above code.
Thanks so much and please feel free to change my question title if I’ve got the wrong terminology!
This would be based on the design of the plugin. If the plugin itself does not allow for multiple callbacks (which this one doesn’t) then you can’t use them.
Instead, just use a single callback. The callback has three arguments including the match and mismatch list and fires every time a tag is added or removed.