Use checkboxes for selections instead of the current full row selection.

This commit is contained in:
Jan Böhmer 2022-09-10 01:26:09 +02:00
parent 1915acf069
commit f6b8e0e227
4 changed files with 75 additions and 20 deletions

View file

@ -0,0 +1,36 @@
<?php
namespace App\DataTables\Column;
use Omines\DataTablesBundle\Column\AbstractColumn;
use Symfony\Component\OptionsResolver\OptionsResolver;
/**
* A column representing the checkboxes for select extensions.
*/
class SelectColumn extends AbstractColumn
{
public function configureOptions(OptionsResolver $resolver)
{
parent::configureOptions($resolver);
$resolver->setDefaults([
'label' => '',
'orderable' => false,
'searchable' => false,
'className' => 'select-checkbox no-colvis',
'visible' => true,
]);
}
public function normalize($value)
{
return $value;
}
public function render($value, $context)
{
//Return empty string, as it this column is filled by datatables on client side
return '';
}
}