Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var fJS;
- jQuery(document).ready(function($) {
- $('#category_all, #nonprofit_all, #price_all').closest('ul').children().find(':checkbox').attr('checked', true);
- $('#category_all, #nonprofit_all, #price_all').click(function(){
- $(this).closest('ul').children().find(':checkbox').attr('checked', $(this).is(':checked'));
- });
- fJS = filterInit();
- });
- function filterInit(){
- var view = function(event_detail){
- clear = this.div({'class': 'clear'});
- title = this.div({'class': 'title'}, event_detail.name);
- date = this.div({'class': 'dates'}, event_detail.date_start);
- event_list = this.div({'class' : 'event_list'} , [title, date, clear]);
- return this.link('/demo/' + event_detail.event_id ,{'title': event_detail.name}, event_list);
- };
- var filter_callbacks = {
- logger: function(result){
- console.log(result);
- },
- show_result_count: function(result){
- $('.result_count').text('Found : ' + result.length);
- },
- tiny_sort: function() {
- $('a[data-fjs]').tsort('.fs_head:visible', {order: 'asc'})
- }
- };
- var settings = {
- filter_criteria: {
- category: ['#category_list input:checkbox .EVENT.click .SELECT.:checked', 'category_id'],
- },
- search: {input: '#search_box' },
- and_filter_on: true, //If any filter selection is zero then select none. For 'OR' filter set 'false'
- callbacks: filter_callbacks //Filter callback execute in filter init and each filtering event.
- };
- return FilterJS(events, "#event_listing", view, settings);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement