Skip to content

Instantly share code, notes, and snippets.

@abhishek-9ithub
Created May 4, 2018 06:35
Show Gist options
  • Save abhishek-9ithub/3182cd19754bcaff3c059338ff3f191c to your computer and use it in GitHub Desktop.
Save abhishek-9ithub/3182cd19754bcaff3c059338ff3f191c to your computer and use it in GitHub Desktop.
data table sorting custum code
$(function(){
var asc = false;
$('.sortable th').click(function(){
if($(this).hasClass('sorting_asc')){
$(this).addClass('sorting_desc');
$(this).removeClass('sorting_asc');
}else{
$('.sortable th').each(function(){
$(this).removeClass('sorting_asc');
$(this).removeClass('sorting_desc');
$(this).addClass('sorting');
});
$(this).addClass('sorting_asc');
$(this).removeClass('sorting_desc');
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment