Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/app/View/Components/Dataform.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class Dataform extends Component
* @param string|null $action Custom form action URL
* @param string $method Form method (post, put, etc.)
* @param bool $focusOnFirstField Whether to focus on the first field when form loads
* @param bool|null $showCancelButton Override for the CRUD cancel button visibility
*/
public function __construct(
public string $controller,
Expand All @@ -30,6 +31,7 @@ public function __construct(
public $entry = null,
public ?Closure $setup = null,
public bool $focusOnFirstField = false,
public ?bool $showCancelButton = null,
public bool $formInsideCard = false,
public array $saveActions = [],
) {
Expand Down Expand Up @@ -71,6 +73,10 @@ public function __construct(
call_user_func($this->setup, $this->crud, $parentEntry);
}

if (! is_null($showCancelButton)) {
$this->crud->setOperationSetting('showCancelButton', $showCancelButton);
}

// Reset the active controller
CrudManager::unsetActiveController();
}
Expand Down