don't manage to make the sum() function works
don't manage to make the sum() function works
fmarguerie
Posts: 36Questions: 3Answers: 0
in my code, I have
<link href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css" rel="stylesheet">
<link href="https://cdn.datatables.net/plug-ins/1.12.1/api/sum().js rel="stylesheet">
function additionColonne(numColonne) {
var table = $('#factures_mo').DataTable();
alert('avant addition');
table.column(numColonne).data().sum();
alert('total');
return (total);
}
I have the following issue : any help please ????
Thanks a lot;
Replies
We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin
There is no test case to link , I ask for help, I might have a problem whtih the syntax somewhere: (
Am I suppose to add something else in my code to get thet plug in sum() works ?
Regards,
François
ah , ok sorry, hope this will be OK
http://live.datatables.net/hegigoso/1/
enter for example 36 in the search box to trigger my code .
when I press F12 and check in the console, the function sum is said "not defined"
at home, I've included :
<link href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css" rel="stylesheet">
<link href="https://cdn.datatables.net/plug-ins/1.12.1/api/sum().js rel="stylesheet">
In the test case you need to include the sum() plugin. Like this:
http://live.datatables.net/hegigoso/2/edit
It looks like you included it above. Make sure its loaded after datatables.js.
Kevin