Filtering not working with custom object
-
Basically, I’m trying to create the filter object via two select boxes.
https://rolland.steadfastlight.com/directory/ to see it in action…
this is the code I’m using:
jQuery(function($) { $('#filter-bar section .filters select').change(function(){ var loc = $('#filter-bar section .filters select:first-child').val(); var dep = $('#filter-bar section .filters select:last-child').val(); var tax = loc + ":" + dep; var data = { button_label : "Load More", taxonomy : "location:department", taxonomy_terms : tax, container_type : "ul", post_type : "directory", posts_per_page : 16 }; if ( $('#filter-bar section .filters select:first-child').val() == "ALL" ) { var tax = dep; var data = { button_label : "Load More", taxonomy : "department", taxonomy_terms : tax, container_type : "ul", post_type : "directory", posts_per_page : 16 }; } if ( $('#filter-bar section .filters select:last-child').val() == "ALL" ) { var tax = loc; var data = { button_label : "Load More", taxonomy : "location", taxonomy_terms : tax, container_type : "ul", post_type : "directory", posts_per_page : 16 }; } console.log(data); $.fn.almFilter('fade', '300', data); // reset Ajax Load More (transition, speed, data) }); $.fn.almFilterComplete = function(){ alm_is_animating = false; // clear alm_isanimating flag }; });
This compiles correctly, and the object itself is changing every time I select a select box, and the object has the proper values, but it appears the object isn’t properly inserting itself into the alm refresh.
Help?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Filtering not working with custom object’ is closed to new replies.