Refresh Index when Data is Updated Dynamically

Refresh Index when Data is Updated Dynamically

ofoshoofosho Posts: 5Questions: 0Answers: 0
edited August 2010 in General
I have a table that I add values to it periodically based on ajax calls. When the call is made a td's inner html will be replaced with something else. This obviously creates a discrepancy between the cached index and what is in the table. My question is: How can I tell the index to refresh itself based on the new table? Should fnDraw() work? It is not, but I will keep trying if it should. If there is no direct API call, could someone tell me where in the code the index is initialized, and I will create an API call myself.

Thanks,

-O

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Do you mean something like this: http://datatables.net/examples/api/counter_column.html . Another option would be to run through the table doing an 'fnUpdate' when the new data comes in.

    Allan
  • ofoshoofosho Posts: 5Questions: 0Answers: 0
    Maybe I can take a piece of that plugin, but I mean if I get ajax data, then use javascript to change the td innerHTML, the datatables index will not reflect this change.

    I will switch from js to fnUpdate, and see if that helps. I have a hunch it will.

    Allan, you have replied to me twice in one day. Amazing and much appreciated. Tip of the hat sir.

    Thanks,

    -O
This discussion has been closed.