Problem with sorting after updating a cell using jQuery's .html()
Problem with sorting after updating a cell using jQuery's .html()
rasmuslindstrom
Posts: 7Questions: 0Answers: 0
Hello!
I have a table where one column is just numbers. If I change a number using jQuery's .html like this: $('#price_123').html(5);
The sorting still treats this '5' like the old value when sorting.
I can't find any information on this, I'm hoping that I just could run like $('#example').dataTable().fnUpdate(); or something =)
Big thanks in advance!
I have a table where one column is just numbers. If I change a number using jQuery's .html like this: $('#price_123').html(5);
The sorting still treats this '5' like the old value when sorting.
I can't find any information on this, I'm hoping that I just could run like $('#example').dataTable().fnUpdate(); or something =)
Big thanks in advance!
This discussion has been closed.
Replies
Allan
I have a which loads a file, which has a script that loops 20 times and each time, it adds a row and does a bunch of other stuff. When using the .html() to update a cell I get 20 new rows and everything is working (except the datatables sorting).
When I changed method, to fnUpdate I only get 8 rows (although sorting works now). If I click on the again, in the first example, I get 20 new rows, in this one, I don't get any rows the second time.
Here's the code that replaces the jQuery .html():
(flight_123_126 is the id of the parent TR)
var pos = $('#example').dataTable().fnGetPosition((flight_123_126));
$('#example').dataTable().fnUpdate('533', pos, 3);
I can't figure out what's the problem, do I need to use "return false;" or something, or is my code not correct?
Thanks in advance!
Thanks,
Allan