Cara Memperbaiki "Uncaught TypeError: table.row is not a function" jQuery Datatable

Saya menemukan error Uncaught TypeError: table.row is not a function saat menambahkan event click pada row datatable. Jadi jika saya melakukan click pada salah satu row, maka event akan dijalankan.

Berikut contoh kodenya yang saya gunakan

        var table = $('#tableNetwork').dataTable();
$('#tableNetwork tbody').on( 'click', 'tr', function () {
console.log( table.row( this ).data() );
});
 

 Ketika saya klik, event tersebut berhasil dijalankan namun terjadi error 


Solusinya adalah, dengan menambahkan function api() pada code diatas yang saya beri warna merah.


Jika sebelumnya 


console.log( table.row( this ).data() );
 

Maka tambahkan menjadi

 

console.log( table.api().row( this ).data() );
 

Dan hasilnya berhasil tidak muncul error

 

 

 

Posting Komentar untuk "Cara Memperbaiki "Uncaught TypeError: table.row is not a function" jQuery Datatable"

Windows System Restore Error "You must enable system protection on this drive"
[solved] Cara Mengatasi Error WslRegisterDistribution failed with error: 0x80004002
Cara Mengetahui Umur Kartu As Telkomsel