Skip to content

Instantly share code, notes, and snippets.

@iamrealfarhanbd
Created August 27, 2024 10:45
Show Gist options
  • Save iamrealfarhanbd/203f9ad045706dee24b99e4b5aaeb691 to your computer and use it in GitHub Desktop.
Save iamrealfarhanbd/203f9ad045706dee24b99e4b5aaeb691 to your computer and use it in GitHub Desktop.
You can add the below code into your table custom js field to hide/show column for dropdown checkbox near the search field.
/*
::::::::::::::::::::::
:: hide/show columns::
::::::::::::::::::::::
*/
jQuery('.dropdown-menu-right input').on('change',function(e){
e.preventDefault();
jQuery('.dropdown-menu-right input').each(function(e){
console.log(jQuery(this).is(":checked"));
if(!jQuery(this).is(":checked")){
jQuery('.ninja_column_'+e).hide()
}else{
jQuery('.ninja_column_'+e).show()
}
});
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment