'jquery Datatable loading multiple rows

I am using jquery datatables to load data into my table: https://datatables.net/examples/data_sources/server_side

I have set a class which returns the formatted json string:

$columns = array(
  array( 'db' => 'first_name', 'dt' => 0 ),
  array( 'db' => 'last_name', 'dt' => 1 ),
  array( 'db' => 'position', 'dt' => 2 ),
  array( 'db' => 'office', 'dt' => 3 ),
  array(
    'db' => 'start_date',
    'dt' => 4,
    'formatter' => function( $d, $row ) {
      return date( 'jS M y', strtotime($d));
    }
  ),
  array(
    'db' => 'salary',
    'dt' => 5,
    'formatter' => function( $d, $row ) {
      return '$'.number_format($d);
    }
  )
);

How is it possible to get multiple db inside an array? For example, I would like to combine first_name and last_name inside a column.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source