how to show summary of row in colomn render
how to show summary of row in colomn render
i have data like this ...
and have problem to show data like this..
the summary of a column use the footerCallback and get 100, and what i imagine to show the remark is something like
{
data: null,
render: function (val, type, row) {
return val + ' / ' + total;
}
}
(total it's just my opinion of variable )
my problem is how to show remark column like that ? i cant get the total
This question has accepted answers - jump to:
Answers
Hi @kharismatics ,
That was a fun puzzle! The problem, as you could tell, is that the
footerCallback
is called late in the process, so it wouldn't be available when the cell data is created.To workaround this, you need to do two draws - one to generate the footer, and a second to fill in the cells - see example here. This may be inefficient if you've got a large amount of data on each page (many, many rows), and in that case you'll probably need to scan the table yourself to get the total (rather than rely on the DataTables framework), but for small amounts of data, this should be fine.
Hope that does the trick,
Cheers,
Colin
Hi @colin
in that fun puzzle case i use a little sql query trick actually, but i'm sure that there is a front-end trick.
your explaination was great and open my mind ..
but i can't open the link you shared (404 Not Found),
just need little bit example
Hi @colin
in that fun puzzle case i use a little sql query trick actually, but i'm sure that there is a front-end trick.
your explaination was great and open my mind ..
but i can't open the link you shared (404 Not Found),
just need little bit example
Odd, the link works for me. Here it is again : http://live.datatables.net/pikebivi/1/edit