only first page of my table loading my javascript characters, 2nd page loads plain text
only first page of my table loading my javascript characters, 2nd page loads plain text
I have a table of words in egyptian hieroglyphs. I'm getting my data with mysql. Here is an example page of my problem:
http://designosystems.com/hieroglyphics/demo.php
When you scroll past the first table results, the text is no longer converted to hieroglyphs. I am pretty sure this is happening because when I go to "page 2" I need to reload somehow, and it doesn't reload, as technically it is already stored. My hieroglyphs would only come up in page reload. Wondering if there is a fix.
Answers
You will probably need to use something like
rowCallback
to have Datatables render the hieroglyphics for each page when displayed.Kevin
Thanks very much, but it didn't work. But I don't know if I did it right as I copied and pasted the example straight to page. and it didn't work, the 2nd page is still not rendering javascript characters. (I also tried both examples, with object and array data sources,) here is the exact text I added, now at http://designosystems.com/hieroglyphics/demofix.php $(document).ready(function() {
$('#example').DataTable({
"order" : [[2, "desc"]],
"lengthMenu" : [[10, 25, 50, -1], [10, 25, 50, "All"]],
"iDisplayLength" : 50,
"rowCallback" : function(row, data, index) {
if (data[4] == "A") {
$('td:eq(4)', row).html('<b>A</b>');
}
}
});
Ok, thanks, I fixed it a different way - "show ALL entries" makes it so the hieroglyphics appear because there is only one page. If someone has a better suggestion that would be welcome. I have 20,000 hieroglyph words, so it takes a while to load it all on one page. Here is the code I change to show all: