Adding extra rows at runtime
Adding extra rows at runtime
Is it possible to add extra rows to a table while it is being rendered, i've looked at the 'add rows' example but i'm not sure if it is exactly what i am looking for.
The data itself comes via ajax and works perfectly, i get a row in the table for every row in the dataset/temp-table, however i have a couple of sales stats that i need to show per row (quantity sold and sales).
Have included a screenshot of the table (as it is currently rendered, can't provide a webpage link as it is an internal point of sale).
http://puu.sh/avBC1/0ea7d04296.png
json data is here: https://onedrive.live.com/redir?resid=6934E091A89EF706!763&authkey=!ADtWtDm0FXm17QQ&ithint=file%2cjson
Basic attempt at using DT Live: http://live.datatables.net/cuvoreb/1/
Not sure how to get the json data into the live view.
Basically, under each row i want a subrow that has to always be showing with the sales quantity.
Answers
It isn't pretty, and there is probably a way better way of doing it, but i have managed to make it work by using:
Moved it from rowCallback to fnCreatedRow to speed up the searching, etc... as i found things were going slow using the former, likely because that was being called every single time and not just when the table was being first rendered.