Question about adding cell text with createdRow
Question about adding cell text with createdRow
chilly
Posts: 7Questions: 4Answers: 0
Hello,
I'm trying to insert in a custom link into a row with datatables using the 'createdRow' option.
I'm hitting an odd error where sometimes I encounter this error: Uncaught TypeError: Cannot read property 'html' of null
This hits on the createdRow line of my Javascript.
When I reload the page a few times, the error seems to disappear and the page generates as expected. Is there any way to work around this issue?
This discussion has been closed.
Answers
Can you link to a page showing the problem so we can try to debug it please? I'm not aware of any issues with
createdRow
at the moment.Allan
I'm not sure if I'm allowed to, since it's an internal company page. Would posting some of the Datatables setup code help?
Oh, I figured out what the issue was. When you want to set the row's cell content ( $('td',row).eq(5).html(.....)), the '$' operator was being overwritten by out content management system (Joomla). I just had to declare the method as jQuery('td':row).eq(0).
Sorry about the confusion!
Cool. Good to hear you got it sorted.
Allan