Witam, mam problem z sortowaniem i wyszukiwaniem z tabeli. Tabelę wczytuje z xml'a za pomocą JS następującym kodem:
<table id='tabela' class='sortable' border='1'> <script type="text/javascript" language="javascript"> xmlhttp=new XMLHttpRequest();
xmlhttp.open("GET","xml/srodtrans.xml",false);
xmlhttp.send();
xmlDoc=xmlhttp.responseXML;
var x=xmlDoc.getElementsByTagName("spis/*");
for (i=0;i<x.length;i++)
{
document.write("<tr><td>");
document.write(x[i].getElementsByTagName("typ")[0].childNodes[0].nodeValue);
document.write("
</td><td>");
document.write(x[i].getElementsByTagName("marka")[0].childNodes[0].nodeValue);
document.write("
</td><td>");
document.write(x[i].getElementsByTagName("model")[0].childNodes[0].nodeValue);
document.write("
</td><td>");
document.write(x[i].getElementsByTagName("tonaz")[0].childNodes[0].nodeValue);
document.write("
</td><td>");
document.write(x[i].getElementsByTagName("rok")[0].childNodes[0].nodeValue);
document.write("
</td></tr>");
}
document.write("
</table>");
Starałem się to sortować za pomocą rozwiązania podanego na tej stronie :http://www.kryogenix.org/code/browser/sorttable/
lecz niestety nie działa ono u mnie, a u znajomych już tak. Czy przyczyną tego może być fakt, iż moja główna strona do której ładuję podstrony jest w php?
Z góry dziękuję za odpowiedź.