Sorting doesn't work after changing the text of a TD tag using JQuery
Sorting doesn't work after changing the text of a TD tag using JQuery
Hi,
I use JQuery to set a click event handler on the link C3. The handler just change the text C3 to Changed. Then the sorting doesn't work. Any way to fix the sorting? Thanks.
Wing
Below is my code.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
$(document).ready(function() {
$('#3').bind('click',function () {
$('#3').text("Changed");
});
$('#example').dataTable();
} );
ID
A
B
C
1
A1
B1
C1
2
A2
B2
C2
3
A3
B3
C3
4
A4
B4
C4
I use JQuery to set a click event handler on the link C3. The handler just change the text C3 to Changed. Then the sorting doesn't work. Any way to fix the sorting? Thanks.
Wing
Below is my code.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
$(document).ready(function() {
$('#3').bind('click',function () {
$('#3').text("Changed");
});
$('#example').dataTable();
} );
ID
A
B
C
1
A1
B1
C1
2
A2
B2
C2
3
A3
B3
C3
4
A4
B4
C4
This discussion has been closed.
Replies
Allan
I am using the paging feature. If the fnUpdate is called in a second page, the whole table will go back to the first page. Any way to stay in the second page instead of going back to the first page?
Thanks a lot.
Wing
There is also the standing redraw plug-in which you can use if you do want the sorting / filtering to be updated (again pass in false as above to fnUpdate), but have the table do a redraw on the current page: http://datatables.net/plug-ins/api#fnStandingRedraw
Allan