S
Stefan Mueller
It's frustrating! Since several days I'm trying to program something
which looks so simple but I'm not able to do it.
I hope someone can give me a hint.
Here is my example code (or use: http://test.seekware.ch/example.html)
=====================================================
<html>
<head>
<script type = "text/javascript" src = "http://test.seekware.ch/
sort.js"></script>
</head>
<body>
<table class = "sortable">
<thead>
<tr><th>Name</th><th>Team</th></tr>
</thead>
<tbody>
<tr><td>Zora</td><td>Liverpool</td></tr>
<tr><td>Albert</td><td>Manchester</td></tr>
<tr><td>Roman</td><td>Tottenham</td></tr>
<tr><td>Steven</td><td>Arsenal</td></tr>
</tbody>
</table>
</body>
</html>
=====================================================
I'd like to have a table where I can sort each column by clicking on
its header. This works pretty well.
Now I'd like have a variable with defines which column has to be
sorted just after the page is loaded. However, I'm not able to call
the function by script to sort the table (it only works by clicking on
its header).
After the page is loaded the function 'page_is_loaded' gets called by
'window.onload = page_is_loaded;'.
Now I'm trying to figure out what command I have to execute (at the
position where currently 'alert ("Here I'd like to call the function
to sort e.g. the first column");' is written) to sort e.g. the first
column of the table just after the page is loaded.
Unbelievable, but I'm not able to sort the table by script. It only
works by clicking on the header of a column.
Any help is very appreciated.
Stefan
which looks so simple but I'm not able to do it.
I hope someone can give me a hint.
Here is my example code (or use: http://test.seekware.ch/example.html)
=====================================================
<html>
<head>
<script type = "text/javascript" src = "http://test.seekware.ch/
sort.js"></script>
</head>
<body>
<table class = "sortable">
<thead>
<tr><th>Name</th><th>Team</th></tr>
</thead>
<tbody>
<tr><td>Zora</td><td>Liverpool</td></tr>
<tr><td>Albert</td><td>Manchester</td></tr>
<tr><td>Roman</td><td>Tottenham</td></tr>
<tr><td>Steven</td><td>Arsenal</td></tr>
</tbody>
</table>
</body>
</html>
=====================================================
I'd like to have a table where I can sort each column by clicking on
its header. This works pretty well.
Now I'd like have a variable with defines which column has to be
sorted just after the page is loaded. However, I'm not able to call
the function by script to sort the table (it only works by clicking on
its header).
After the page is loaded the function 'page_is_loaded' gets called by
'window.onload = page_is_loaded;'.
Now I'm trying to figure out what command I have to execute (at the
position where currently 'alert ("Here I'd like to call the function
to sort e.g. the first column");' is written) to sort e.g. the first
column of the table just after the page is loaded.
Unbelievable, but I'm not able to sort the table by script. It only
works by clicking on the header of a column.
Any help is very appreciated.
Stefan