HubSpot custom module to display data from hubdb and search filter
Hello everyone, I'm trying to create a custom module in HubSpot to display data from hubdb and i also to make a search filter so that users can search for some specific info on the pay but i'm having some issue with the filter. Could anyone assist me? Below is my code so far.
Here is my hubDB Table column (i'm using dynamic pages): | hs_name | hs_path | title | decription | country | date | location | language | image | url |
function updateEvents() { var country = $('select.country').val(); var language = $('select.language').val(); var tags = $('select.tags').val(); var search = $("#myInput").val();
$('.FilterContainer') .find('.column') .hide() .filter(function() { var okCountry = true; var okLanguage = true; var okTags = true; var okSearch = true;
if (country !== "all") { okCountry = $(this).attr('data-country') === country; } if (language !== "all") { okLanguage = $(this).attr('data-language') === language; } if (tags !== "all") { okTags = $(this).attr('data-teacher') === tags; } if (search !== '') { okSearch = $(this).text().toLowerCase().indexOf(search) > -1; } //only fade a room if it satisfies all four conditions return okCountry && okLanguage && okTags && okSearch; }).fadeIn('fast'); } </script>