How to render a div element in a cell (and use pagination)
How to render a div element in a cell (and use pagination)
emepyc
Posts: 8Questions: 2Answers: 0
Hi,
I need to render a div element inside a datatable cell and append children to that div. A minimal version of what I'm trying to to is in this jsfiddle: http://jsfiddle.net/emepyc/f9uf3suk/
I'm having a couple of problems with this:
- Searching doesn't fire "fnDrawCallback", which means that if you search for an entry not previously displayed, the div is not populated (in the fiddle, searching for "L", for example).
- I'm relying on settings._iDisplayStart and settings._iDisplayLength, but _iDisplayLength always give the max number of rows to display in the table (10) regardless how many are currently displayed (can be less).
A method that is fired on every redraw is fnRowCallback, but this is fired before the rows are rendered (so the div's have not been created yet).
Is there a way of doing this that I'm missing?
Thanks in advance!
M;
This discussion has been closed.
Answers
I've solved this by using fnRowCallback and creating the div element there:
Something like:
Updated jsfiddle: http://jsfiddle.net/emepyc/f9uf3suk/1/