Kod
//now sort table
if(sort_td_index!=undefined) {
$(table + ' tr:gt(1)').each(function() {
act_tr_1 = this;
act_td_1 = $('td:eq(' + sort_td_index + ')' ,this).html().toLowerCase();
$(table + ' tr:gt(1)').each(function() {
act_td_2 = $('td:eq(' + sort_td_index + ')' ,this).html().toLowerCase();
if ((act_td_2 > act_td_1 && sort_opt=='asc') || (act_td_2 < act_td_1 && sort_opt=='desc')) {
$(act_tr_1).insertBefore(this);
}
});
});
}//end if
if(sort_td_index!=undefined) {
$(table + ' tr:gt(1)').each(function() {
act_tr_1 = this;
act_td_1 = $('td:eq(' + sort_td_index + ')' ,this).html().toLowerCase();
$(table + ' tr:gt(1)').each(function() {
act_td_2 = $('td:eq(' + sort_td_index + ')' ,this).html().toLowerCase();
if ((act_td_2 > act_td_1 && sort_opt=='asc') || (act_td_2 < act_td_1 && sort_opt=='desc')) {
$(act_tr_1).insertBefore(this);
}
});
});
}//end if
Jednak nie działa jak należy. Co robię źle?