custom column beta

This commit is contained in:
Билай Станислав 2024-07-31 16:32:44 +03:00
parent f5f6504545
commit 8bc8a75a53

View File

@ -28,6 +28,7 @@ class ListJsonTable
private array $actionsArray = []; private array $actionsArray = [];
private array $customActionsArray = []; private array $customActionsArray = [];
private array $customColumnsArray = [];
#[NoReturn] public function __construct(string $json) #[NoReturn] public function __construct(string $json)
{ {
@ -97,6 +98,15 @@ class ListJsonTable
} }
} }
// if (isset($col['id'])) {
// $newColumn = $this->getColumns($col['id']);
//
// $this->html .= "<td>$newColumn</td></tr>";
// }
// else {
// $this->html .= "<td></td></tr>";
// }
if (isset($col["id"])){ if (isset($col["id"])){
$actions = $this->getActions($col["id"]); $actions = $this->getActions($col["id"]);
@ -114,6 +124,8 @@ class ListJsonTable
$this->customActionsArray[] = $actionColumn; $this->customActionsArray[] = $actionColumn;
} }
private function setActions(): void private function setActions(): void
{ {
if (isset($this->data['meta']['actions'])) { if (isset($this->data['meta']['actions'])) {
@ -160,6 +172,17 @@ class ListJsonTable
return false; return false;
} }
// private function getColumns(int $id): string
// {
// $columns = [];
// foreach ($this->actionsArray as $item) {
// $objItem = new $item($this->baseUrl, $id);
// $columns .= $objItem->fetch();
// }
//
// return $columns;
// }
private function getActions(int $id): string private function getActions(int $id): string
{ {
$actions = ""; $actions = "";