![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 189 Pomógł: 1 Dołączył: 28.01.2008 Ostrzeżenie: (0%) ![]() ![]() |
Napisałem prosty kod do sortowania tabeli względem jednego wiersza, którego indeks znamy. Wygląda on tak:
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 Jednak nie działa jak należy. Co robię źle? Ten post edytował S_Olewniczak 6.07.2009, 09:40:15 |
|
|
![]() ![]() |
![]() |
Aktualny czas: 22.08.2025 - 01:46 |