Builder Column represents the column to be rendered by your dataTables.
You can use addColumn
api to add a single column and columns
api to add multiple columns.
A DataTable Column
accepts the following attributes:
$column = [
'name' => 'id',
'data' => 'id',
'title' => 'Id',
'searchable' => true,
'orderable' => true,
'render' => 'function(){}',
'footer' => 'Id',
'exportable' => true,
'printable' => true,
];
You also need to look at datatables.net
official columns documentation for further reference.
Name attribute represents the column
name from your data source.
DataTables will use this attribute when performing search and ordering functions.
{tip} If not set,
name
attribute will automatically be set to same value asdata
attribute.
Data attribute will be used when rendering the response to your table. This is the key
from the json
response data
array.
Title attribute is used as your table
column heading <th>{{$title}}</th>
.
{tip} If not set,
data
attribute value will be use astitle
with title case format.
Searchable attribute will toggle the searching
ability for the defined column. Default value is true
.
Orderable attribute will toggle the ordering
ability for the defined column. Default value is true
.
Render attribute is a js
script string that you can use to modify the way the column is being rendered via javascript
.
Export Render attribute is a php callback function
that you can use to modify the way the column is being rendered via print
or export (CSV/Excel/PDF)
.
Footer attribute will be as your tables
column's footer
content <tfoot></tfoot>
.
{tip} To display the footer using html builder, pass
true
as 2nd argument on$builder->table([], true)
api.
Exportable attribute will flag the column to be included when exporting
the table. Default value is true
.
Exportable attribute should be used with the Buttons Plugin
Printable attribute will flag the column to be included when printing
the table. Default value is true
.
Exportable attribute should be used with the Buttons Plugin