Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 81997

mySQL join

$
0
0
Hi,
I am following the tutorial to the letter, but in my own implementation,
1) My SELECT box is empty (edit/new)
2) I get a JS error:
Undefined is not an object (line 1617(
>>> var fieldType = Editor.fieldTypes[ fieldConf.type ];


#
The PHP code which I use

# Table layout

tblExerciseEquipment
EEquipmentID
EquipmentName
f_LanguageID

tblLanguages
LanguageID
LName

# PHP code

Editor::inst( $db, 'tblExerciseEquipment' )
->fields(
Field::inst( 'EquipmentName' )->validator( 'Validate::required' ),
Field::inst( 'f_LanguageID' )->validator( 'Validate::required' )
)
->join(
Join::inst('tblLanguages','object')
->join('f_LanguageID','LanguageID')
->fields(
//Field::inst( 'LanguageID' )->validator( 'Validate::required' ),
Field::inst( 'LName' ))
)
->pkey('EEquipmentID')
->process( $_POST )
->json();

# JS

editor = new $.fn.dataTable.Editor( {
"ajaxUrl": "ajax_content_exerciseEquipment.php",
"domTable": "#tblExerciseEquipment",
"fields": [ {
"label": "Language:",
// The 'id' value from the property is used to set the value
// of the select list.
"name": "tblLanguages.LanguageID",
"type": "select"
},
{
"label": "Equipment name:",
"name": "EquipmentName"
}
]
} );

$('#tblExerciseEquipment').dataTable( {
"sDom": "Tfrtip",
"sAjaxSource": "ajax_content_exerciseEquipment.php",
"aoColumns": [

{
// Use the 'name' property from the 'dept' object in the
// JSON. It might not be set, so we also provide a default.
"mData": "tblLanguages.LName",
"sDefaultContent": ""
},
{ "mData": "EquipmentName" }
],
"oTableTools": {
"sRowSelect": "multi",
"aButtons": [
{ "sExtends": "editor_create", "editor": editor },
{ "sExtends": "editor_edit", "editor": editor },
{ "sExtends": "editor_remove", "editor": editor }
]
},
"fnInitComplete": function ( settings, json ) {
// Set the allowed values for the select and radio fields based on
// what is available in the database
editor.field('dept.id').update( json.dept );
editor.field('access[].id').update( json.access );
}
} );

Viewing all articles
Browse latest Browse all 81997

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>