Can I use sum() api without jQuery?
Can I use sum() api without jQuery?
I'm instantiating the table like this and trying to use the sum api like this.
import DataTable from "datatables.net";
import 'datatables.net-plugins/api/sum().mjs';
const table = new DataTable('#jobsTable', {
serverSide: true,
ajax: '/jobs/load',
orderMulti: false,
language: {
searchPlaceholder:"Date? eg '2023-12-31'"
},
drawCallback: function () {
var api = this.api()
$( api.table().footer() ).html(
api.column( 4, {page:'current'} ).data().sum()
)
},
columns: [
// column data
]
can I use the sum api without jQuery? If it's possible then how?
Answers
Sure, the
column().footer()
method just returns a cell element, so you can use:Allan