dt.on function Expected 2 arguments, but got 3
dt.on function Expected 2 arguments, but got 3
Debugger code (debug.datatables.net):
import type { Api } from 'datatables.net'
let dt: Api<any>
onMounted(() => {
// Get a DataTables API reference
if (dataTable.value) {
dt = dataTable.value.dt
}
// Activate an inline edit on click of a table cell
dt.on('click', 'tbody td:not(:first-child)', function () {
editor?.inline(this, {
onBlur: 'submit'
})
})
})
Error messages shown:
Expected 2 arguments, but got 3.
Description of problem:
I follow example of vue3 and pass 'tbody td:not(:first-child)' as argument, but the Typescript complain dt.on function expected 2 arguments, but got 3.
Answers
That's an error in our Typescript file - apologies. As a workaround for the moment do:
Allan
Commit for the fix here.
Allan