Support

Home Forums Custom Files Add-on (EE3) EVENT_CUSTOM_VIEW Status

EVENT_CUSTOM_VIEW Status

Posted: June 6, 2014 at 10:53 am


pmitriadnc

June 6, 2014 at 10:53 am

I am using EVENT_CUSTOM_VIEW tableview. The table has the ‘Filter by category’ dropdown.
I added a ‘Status’ column that shows if the event is open or closed. If the user selects a category that does not have any listings how can I show a message like, “There are currently no events scheduled”


Dean

June 10, 2014 at 6:41 am

Hi,

If you replace the JavaScript in the template file with this is should do what you need. Please note that this is only an example and may need further tweaking to meet your specific needs.

<script type="text/javascript">

jQuery(document).ready(function(){

	jQuery("#ee_filter_cat").change(function() {

		var ee_filter_cat_id = jQuery("option:selected").attr('class');
		//console.log(ee_filter_cat_id);
		jQuery("#ee_filter_table .espresso-table-row").show();
		jQuery("#ee_filter_table .espresso-table-row").each(function() {
			if(!jQuery(this).hasClass(ee_filter_cat_id)) {
				jQuery(this).hide();
			}
		});
		if( ee_filter_cat_id == 'ee_filter_show_all') {
			jQuery("#ee_filter_table .espresso-table-row").show();
		}

		var empty_row_check = jQuery('#ee_filter_table tbody .espresso-table-row:visible').length;

		if(empty_row_check > 0 ) {
			jQuery('#norow').remove();
		} else {
			if(jQuery('#norow').length == 0) {
				jQuery('#ee_filter_table tbody').append('<tr id="norow"><td colspan="4" style="text-align:center">No Events Found</td></tr>');
			}
		}

	});


});

</script>


pmitriadnc

June 10, 2014 at 2:32 pm

Dean,

Perfect. Works great.

Thank you for the solution and your quick response.

Thanks,
Alan

The support post ‘EVENT_CUSTOM_VIEW Status’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso