Uncaught TypeError: Cannot read property 'oFeatures' of undefined in editor with left join
Uncaught TypeError: Cannot read property 'oFeatures' of undefined in editor with left join
Dika93
Posts: 3Questions: 2Answers: 0
My js is like this
$(document).ready(function() {
editor = new $.fn.dataTable.Editor( {
"ajax": "datasoal.php",
"table": "#tabel1",
"fields": [
{
"label":"Nomor",
"name": "alat_tes.no"
}, {
"label":"Kategori soal:",
"name": "kategori.nama_kategori"
}, {
"label":"Jenis",
"name": "alat_tes.jenis"
}, {
"label":"Soal :",
"name": "alat_tes.soal"
}, {
"label":"Penjelasan :",
"name": "alat_tes.penjelasan"
}
]
} );
My server side script
<?php
/*
* Example PHP implementation used for the index.html example
*/
// DataTables PHP library
include( "php/DataTables.php" );
// Alias Editor classes so they are easy to use
use
DataTables\Editor,
DataTables\Editor\Field,
DataTables\Editor\Format,
DataTables\Editor\Mjoin,
DataTables\Editor\Options,
DataTables\Editor\Upload,
DataTables\Editor\Validate;
// Build our Editor instance and process the data coming from _POST
Editor::inst( $db, 'alat_tes' )
->fields(
Field::inst( 'alat_tes.no' ),
Field::inst( 'kategori.nama_kategori' ),
Field::inst( 'alat_tes.jenis' ),
Field::inst( 'alat_tes.soal' ),
Field::inst( 'alat_tes.penjelasan' )
)
->leftJoin( 'kategori_soal as kategori', 'kategori.id_kategori', '=', 'alat_tes.id_kategori' )
->process( $_POST )
->json();
Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Can you show me your DataTables initialisation as well please?
Thanks,
Allan
I'm afraid I don't actually see what would be causing the issue there I'm afraid - that code looks okay. Can you link to the page showing the issue so I can attempt to debug it?
Thanks,
Allan