Only a value in the table column
Only a value in the table column
Hildeb67
Posts: 77Questions: 21Answers: 1
in DataTables 2
I use a “Nationality” selection field in my form. This is displayed correctly in the form, but only the value in the table. Here is a code snippet
}, {
label: "Nationalität:",
name: "mitgliederstamm.NATION",
type: "select"
}, {
{ data: "mitgliederstamm.NATION",
"render": function (data, type, row) {
if (type === 'display') {
}
return data;
},
},
Field::inst( 'mitgliederstamm.NATION' )
->options( Options::inst()
->table( 'nationalitaeten' )
->value( 'ID' )
->label('Nationalität')
->label( array('NATIONALITAET', 'SPRACHE') )
->render( function ( $row ) {
return $row['NATIONALITAET'].' '.$row['SPRACHE'].'' ;
} )
),
Link to test case:
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:
This question has an accepted answers - jump to answer
Answers
I presume this is a join - you include a
Field
for the joined label that you want to show to the end user, and setcolumns.data
to be that for the DataTable.If you have a look at this example, you'll see that the form worked on
users.site
, but the DataTable displayssites.name
.Allan
Great thanks Allan it worked
Chris