This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Dynamic table jQuery sort adding old rows

 
Kumanan Guna
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I need help to fix jquery sortable issue for dynamic table.

I have one customer html table and onclick making db call, then populating the output in dynamic table. Output always change, because it's based on timestamp (don't have any issues with output here.)

Problem comes after populating dynamic rows and when I try to sort by clicking table header getting old records also in the table. Please help.

for example:

First time Dynamic Table shows.

A B C

Second time Dynamic Table shows below when i try to sort. But table suppose to have only D E F row.

A B C
D E F


Thanks.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33694
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As the AJAX example shows, you are appending data each time. If you want to remove data, I think you'd need to re-initialize the table each time. This example shows how to initialize it up front. You'd need to change the code to do it each time.
 
Kumanan Guna
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne Boyarsky wrote:As the AJAX example shows, you are appending data each time. If you want to remove data, I think you'd need to re-initialize the table each time. This example shows how to initialize it up front. You'd need to change the code to do it each time.




Hi Jeanne,

The example shows those are static tables.

In my case, i get a respose in XML, iterating through out all element in xml and adding each rows in a table. Also before adding any rows, i m deleting all rows in table and start adding new rows.



I don't have any problem in adding and deleting rows in table.

Once data is available in table, when I try to sort table appending with previous results also.

For example, first time i try to sort 10 rows, 2nd time I got a new 3 result and try to sort, table appending with 13 (old + new records). Is there any cache tablesorting storing this information ? Do I need to clear the cache before appending new data ?

Thanks.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33694
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It doesn't sound like you want to append new data. It sounds like you want to do a replace (which is clear the table and add all the existing records.) The reason is that simply appending new data doesn't tell you if data has been deleted from the source table.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic