I was wondering if anyone can point me in the direction of examples or sample code for a few things regarding table manipulation I'm trying to achieve but haven't been able to crack yet.
I currently have a table of data being produced that is sorted and displayed using Tablesorter plugin for Jquery.
I would like to add these extra bits of functionality
I hope this has been clear, the part i'm a bit sceptical about the most is point 4 with the focus issue, but I think facebook seem to do that with their Live news feed. It doesn't seem to update until i have the window in focus (or so i assume)
Any help and guidance would be greatly appreciated!
My table is in this form:
<table class="tablesorter" cellspacing="1">
<thead>
<tr>
<th>ID</th>
<th>lid</th>
<th>Time</th>
<th>Season</th>
<th>Keyword</th>
<th>Campaign</th>
<th>IP</th>
</tr>
</thead>
<tbody>
<tr>
<td class="id">6875</td>
<td class="lid">-----</td>
<td class="time">28 Nov 09 16:35:24</td>
<td class="season">xxx xxx</td>
<td class="keyword">xx xx xxxx</td>
<td class="campaign">xxx</td>
<td class="ip">xx.xx.xx.xx</td>
</tr>
<tbody>
<table>
1: To trigger an event every few seconds in JavaScript, use setTimeout()
. Use the :last
filter to help you grab that last row. Store the id in a hidden input field inside the last row.
2: Last I tried, fades and roll-downs did not work well on table rows. I've had to create really ugly hacks to get this functionality to work such as creating a whole new <table>
per row. Maybe things have improved in recent versions of jQuery? Check out Effects for a list of ways you can animate your content.
3: You can implement this using callbacks just like with fades and roll-downs and other effects.
4: I don't have experience with detecting window focus, though it does seem like there are resources out there that can help you with this. Here are a couple: http://www.webdeveloper.com/forum/archive/index.php/t-33457.html http://www.thefutureoftheweb.com/blog/detect-browser-window-focus