@@ -186,7 +186,7 @@ class AdminController extends EasyAdminController | |||
$fields = $this->entity['list']['fields']; | |||
$paginator = $this->findAll($this->entity['class'], $this->request->query->get('page', 1), 500, $this->request->query->get('sortField'), $this->request->query->get('sortDirection'), $this->entity['list']['dql_filter']); | |||
dump($paginator->getCurrentPageResults()); | |||
$this->dispatch(EasyAdminEvents::POST_LIST, ['paginator' => $paginator]); | |||
$positionForm = $this->createFormBuilder(array('entities', $paginator->getCurrentPageResults())) |
@@ -10,23 +10,23 @@ trait SortableTrait | |||
{ | |||
/** | |||
* @var string | |||
* @ORM\Column(type="integer") | |||
* @ORM\Column(type="float") | |||
*/ | |||
protected $position = 0; | |||
/** | |||
* @return int | |||
* @return float | |||
*/ | |||
public function getPosition(): int | |||
public function getPosition(): float | |||
{ | |||
return $this->position; | |||
} | |||
/** | |||
* @param int $position | |||
* @param float $position | |||
* @return $this | |||
*/ | |||
public function setPosition(int $position): self | |||
public function setPosition(float $position): self | |||
{ | |||
$this->position = $position; | |||
return $this; |
@@ -22,11 +22,9 @@ function initLcSortableList() { | |||
$(li).append(newForm); | |||
$(li).find('#form_entities_' + index + '_id').val($(li).data('id')); | |||
if ($('.lc-sortable').data('parent-position') !== '') val = $('.lc-sortable').data('parent-position') + '_' + index | |||
if ($('.lc-sortable').data('parent-position') !== '') val = $('.lc-sortable').data('parent-position') + '.' + index | |||
else val = index; | |||
log($(li).find('#form_entities_' + index + '_position')); | |||
$(li).find('#form_entities_' + index + '_position').val(val); | |||
}); | |||