Skip to content

Instantly share code, notes, and snippets.

@reachkamrul
Created December 21, 2021 10:04
Show Gist options
  • Save reachkamrul/34cbcd4ca2cf67d1eb3d178ab031dddc to your computer and use it in GitHub Desktop.
Save reachkamrul/34cbcd4ca2cf67d1eb3d178ab031dddc to your computer and use it in GitHub Desktop.
// To hide before filter
//css
#footable_parent_NT_ID{
opacity:0;
}
// js
$table.on("after.ft.filtering", function () {
jQuery(".ninja-custom-filter").each(function(){
var m = jQuery(this).find(':input option:selected');
if(!m.val()){
jQuery(this).parents('table:not(.ninja_has_filter)').find('tbody').remove();
jQuery(this).parents('table:not(.ninja_has_filter)').find('tfoot').remove();
jQuery(this).parents('table:not(.ninja_has_filter)').find('.footable-header').remove();
jQuery(this).parents('table:not(.ninja_has_filter)').find('.ninja_table_buttons-header').remove();
jQuery(this).parents('table').removeClass('ninja_has_filter');
jQuery('thead .no-data').remove();
jQuery(this).parents('table').find('thead').append('<tr class="no-data"><th colspan="100%"> No data found </th></tr>');
}
jQuery('.footable_parent').attr('style', 'opacity: 1 !important')
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment