restruct code for additional features
This commit is contained in:
parent
286c93ef56
commit
0ba4bb3e26
8
sortt.js
8
sortt.js
@ -55,10 +55,16 @@ if(!window.jQuery) {
|
|||||||
|
|
||||||
//use JQuery to bind event on each <th> with a "data-sortt" attribute
|
//use JQuery to bind event on each <th> with a "data-sortt" attribute
|
||||||
$('th').each(function() {
|
$('th').each(function() {
|
||||||
if ($(this)[0].dataset.sortt) $(this).on('click', function(e) {
|
//if data attribute sortt is set
|
||||||
|
if ($(this)[0].dataset.sortt) {
|
||||||
|
//add onclick event
|
||||||
|
$(this).on('click', function() {
|
||||||
var data = $(this)[0].dataset.sortt;
|
var data = $(this)[0].dataset.sortt;
|
||||||
data = data.split(",");
|
data = data.split(",");
|
||||||
sortt(data[0],data[1],data[2]);
|
sortt(data[0],data[1],data[2]);
|
||||||
});
|
});
|
||||||
|
//add arrow to colume
|
||||||
|
// - place holder -
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user