You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a crud which itself has an addModalAction that opens a modal show a child model's crud. If I addDraggable to that child model's crud, it throws an error:
$crud = \Atk4\Erp\Crud::addTo($app);
$crud->setModel($model = new Model\TicketType($app->db));
$crud->addModalAction(['icon'=>'tags'], ['title' => 'Edit tags'], function ($v, $id) use ($crud, $model) {
$entity = (clone $model)->load($id);
$crud2 = \Atk4\Ui\Crud::addTo($v);
$crud2->setModel($entity->ref('TicketTags'));
$dragHandler = $crud2->addDragHandler();
$dragHandler->onReorder(function ($order) use ($model){
$model->atomic(function () use ($model, $order) {
foreach ($model as $entity) { $entity->save(['sort' => array_search($entity->id, $order)]); }
});
return new \Atk4\Ui\Js\JsToast('New sort order saved.');
});
});
The error is API JavaScript Error Can't find variable: Draggable upon opening of the modal.
The text was updated successfully, but these errors were encountered:
mvorisek
changed the title
Draggable crud not working inside modal action
Draggable CRUD not working inside modal action
Nov 3, 2023
I have a crud which itself has an addModalAction that opens a modal show a child model's crud. If I addDraggable to that child model's crud, it throws an error:
The error is
API JavaScript Error Can't find variable: Draggable
upon opening of the modal.The text was updated successfully, but these errors were encountered: