diff --git a/composer.json b/composer.json index 822b889..2e139a0 100644 --- a/composer.json +++ b/composer.json @@ -4,5 +4,8 @@ "license": "MIT", "autoload": { "psr-4": {"atk4\\invoice\\":"src/"} + }, + "require": { + "atk4/ui": "^2.0" } } diff --git a/src/Invoice.php b/src/Invoice.php index 65d944d..8bbb4c4 100644 --- a/src/Invoice.php +++ b/src/Invoice.php @@ -40,8 +40,6 @@ public function init() { parent::init(); - $this->app->useSuiVue(); - if (!$this->grid) { $this->grid = new Grid(['paginator' => ['urlTrigger' => 'p'], 'sortTrigger' => 'sortBy']); } @@ -81,16 +79,16 @@ public function displayInvoices() $g->quickSearch->useAjax = false; $g->quickSearch->initValue = $this->search; - $g->addAction(['icon' => 'edit'], $this->jsIIF($this->invoicePage->getURL())); + $g->addActionButton(['icon' => 'edit'], $this->jsIIF($this->invoicePage->getURL())); if ($this->hasPayment) { - $g->addAction(['icon' => 'dollar sign'], $this->jsIIF($this->paymentPage->getURL())); + $g->addActionButton(['icon' => 'dollar sign'], $this->jsIIF($this->paymentPage->getURL())); } - $g->addAction(['icon' => 'print'], $this->jsIIF($this->printPage->getURL('popup'))); + $g->addActionButton(['icon' => 'print'], $this->jsIIF($this->printPage->getURL('popup'))); - $g->addAction(['icon' => 'trash'], function ($jschain, $id) { + $g->addActionButton(['icon' => 'trash'], function ($jschain, $id) { $this->model->load($id)->delete(); return $jschain->closest('tr')->transition('fade left'); diff --git a/src/InvoiceMgr.php b/src/InvoiceMgr.php index 47728aa..84b5d92 100644 --- a/src/InvoiceMgr.php +++ b/src/InvoiceMgr.php @@ -188,9 +188,9 @@ public function init() // Add payment table. $g = $page->add('Table'); $g->setModel($this->paymentModel); - $actions = $g->addColumn(null, 'Actions'); - $actions->addAction(['icon' => 'edit'], $this->invoice->jsIIF($paymentEdit->getURL(), 'pId')); - $actions->addAction(['icon' => 'trash'], function ($js, $id) use ($g, $seg){ + $actions = $g->addColumn(null, 'ActionButtons'); + $actions->addButton(['icon' => 'edit'], $this->invoice->jsIIF($paymentEdit->getURL(), 'pId')); + $actions->addButton(['icon' => 'trash'], function ($js, $id) use ($g, $seg){ $g->model->load($id)->delete(); return [$js->closest('tr')->transition('fade left'), $seg->jsReload()];