Get cell reference inside render function
Get cell reference inside render function
LoLo2207
Posts: 3Questions: 1Answers: 0
Hi, I'm a newbie with JS, JQuery and DataTables, and I have an assignment where after filling a table, I have to make a QR code in one of the columns.
I'm using this JS library http://jeromeetienne.github.io/jquery-qrcode/
It needs a reference to where to insert the qr code
jquery('#whereToInsert').qrcode("What to encode");
How can i get the reference to the current cell inside the render function?
This discussion has been closed.
Answers
Ok i've managed to render the code using aoColumDefs and fnCreatedCell, but feels like a sloppy way of doing it.
Any better solution?
Also I need to try to make it prettier by showing a link and then the code. Any ideas?
With a quick look at the plugin, I would have done something like:
The div is created succesfully, but the createdRow gives me this error
Why? It looks okay to me! You need to wait for DataTables to have created the cell and
columns.createdCell
orcreatedRow
is how that can be done.Allan