@@ -91,4 +91,10 @@ class FieldDescriptionCollection implements \ArrayAccess, \Countable
{
return count($this->elements);
}
+
+ public function reorder(array $keys)
+ {
+ array_unshift($keys, 'batch');
+ $this->elements = array_merge(array_flip($keys), $this->elements);
+ }
@@ -112,4 +112,15 @@ class ListMapper
return $this;
+ /**
+ * @param array $keys field names
+ * @return \Sonata\AdminBundle\Datagrid\ListMapper
+ */
+ $this->list->reorder($keys);
+ return $this;