-
Notifications
You must be signed in to change notification settings - Fork 70
Description
I want to use the form on the top to apply something like delete for multiple rows.
Using the setMultiple-Methode I’m having the bug that the order is always applied to the next column.
Without setMultiple it works fine.
Here is the code:
private function _datatable()
{
$datatable = $this->get('datatable');
$datatable->setEntityManager($this->getDoctrine()->getManager()) // Optional
->setEntity("EasylearnCoreBundle:EduStructItem", "e") // Replace "XXXMyBundle:Entity" by your entity
->setFields(
array(
"Id" => 'e.id', // Declaration for fields:
"Titel" => 'e.title', // "label" => "alias.field_attribute_for_dql"
"identifier" => 'e.id') // you have to put the identifier field without label. Do not replace the "identifier"
)
->addJoin('e.lang', 'l', \Doctrine\ORM\Query\Expr\Join::INNER_JOIN)
->setOrder("e.title", "asc") // it's also possible to set the default order
->setHasAction(false)
->setSearch(TRUE)
->setSearchFields(array(0,1))
->setMultiple(
array(
'delete' => array(
'title' => 'Delete',
'route' => 'ali_mdelete' // path to multiple delete route
)
)
); // you can disable action column from here by setting "false".
return $datatable;
}
Please let me know when you fixed the bug.