Open stepgr opened 1 day ago
Ok continuing on my own can someone confirm I'm going on the right track ? this is expanding the Quick starter code but there is formatting issues when I put the render function after the targets :
public function html(): HtmlBuilder
{
return $this->builder()
->setTableId('users-table')
->columns($this->getColumns())
->minifiedAjax()
//->dom('Bfrtip')
->orderBy(2, 'asc')
->selectStyleSingle()
->columnDefs(
['targets', [4]],
)
You can do it via Column builder:
Column::make('amount')->renderRaw('function() {alert("test")}'),
Column::make('amount')->render('(data).toFixed(2).replace(/\B(?<!\.\d*)(?=(\d{3})+(?!\d))/g, ",")');
You can also use a renderer. Assuming you have this render function $.fn.dataTable.render.rendererFunction
:
Column::make('amount')->renderJs('rendererFunction')
Summary of problem or feature request
In plain JS something like below is used to make Blade display an icon when a boolean value is set. Following your example from Quick Starter where am I supposed to add this code below ? Blade file ? ControllerDataTable.php ? Controller.php ? I'm lost !!
Code snippet of problem
System details