I have html table that get data from mysql.
Every 5 seconds I check if there is any changes in mysql table using ajax and update specific html table cells.
Now I want to use this nice jquery plugin:
http://mitya.co.uk/scripts/Table-sort—now-REGEXP-friendly-111
So there is a plan:
1. Load table
2. Every 5 sec check if any cells are need to be updated
3. Run jquery table sort plugin.
The question is how to find html cell which I want to update? After sorting all data is moving in table.
I tried to load table from my sql by:
while ($row = mysql_fetch_assoc($result))
{
echo "<tr id='{$row[id]}'>
But sorting plugin moving only data. Not entire html rows…
Can you use jquery’s empty() function to empty out the table and then redraw all the rows?
Alternatively, you could use the id attribute to reference a specific row using the table’s unique index.
ex:
<tr id="row<?=$row->id?>"><td id="name<?=$row->id?>"><?=$row->name?></td><td id="count<?=$row->id?>" ><?=$row->count?></td></tr>and then use jquery to update each rows content accordingly