Moin!
Ich hab mich ja schon als JS/DOM-Noob geoutet, also frisch weiter (sonst bleibt das ja so
)...
Ich habe eine Tabelle, deren Einträge von den Usern sortiert werden sollen/müssen. Beispiel:
Quelltext
1: 2: 3: 4:
| Eintrag 1 | v Eintrag 2 | v^ Eintrag 3 | v^ Eintrag 4 | ^ |
Die Icons am Ende setzen das Sortierkriterium in der Datenquelle, beim Reload der Seite ist dann die Reihenfolge geändert. Funktioniert, soweit, sogut bzw. schlecht.
Die User nörgeln nun - zu recht!
- dass die Reloads nerven und dass man nur in 1er-Schritten was ändern kann (wenn man einen neuen Eintrag erzeugt, steht der natürlich ganz unten und muss ggfs. weit nach oben; dafür habe ich bisher Top-Down-Controls zusätzlich, so dass die Distanz zumindest halbiert wird; jaja, gut ist was anderes
).
Also, Daten per AJAX in der Tabelle ändern (kein Problem
) und die Nodes im DOM-Baum umhängen (das ist das Problem!
). Hier brauche ich mal eure Hilfe: wie tauscht man die beiden TR-Nodes, ohne eine Kopie eines davon anzulegen? Irgendwie hat das Netz nix hergegeben, mit dem ich was anfangen konnte...
Oder geht das gar nicht ohne Kopieren eines Nodes?
Hat da jemand schon eine Lösung oder wie macht ihr das?
cu
Narses
Moderiert von Christian S.: Topic aus JavaScript - Sprachelemente verschoben am Di 25.03.2014 um 19:51
There are 10 types of people - those who understand binary and those who don´t.