Created
May 4, 2018 06:35
-
-
Save abhishek-9ithub/3182cd19754bcaff3c059338ff3f191c to your computer and use it in GitHub Desktop.
data table sorting custum code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(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