12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?php
- namespace Dcat\Admin\Grid\Actions;
- use Dcat\Admin\Form;
- use Dcat\Admin\Grid\RowAction;
- class QuickEdit extends RowAction
- {
- protected static $resolvedWindow;
- /**
- * @return array|null|string
- */
- public function title()
- {
- return __('admin.quick_edit');
- }
- public function render()
- {
- if (! static::$resolvedWindow) {
- static::$resolvedWindow = true;
- [$width, $height] = $this->parent->option('dialog_form_area');
- $title = trans('admin.edit').' - '.$this->key();
- Form::modal($title)
- ->click(".{$this->elementClass()}")
- ->dimensions($width, $height)
- ->forceRefresh()
- ->success('LA.reload()')
- ->render();
- }
- $this->setHtmlAttribute([
- 'data-url' => "{$this->resource()}/{$this->key()}/edit",
- ]);
- return parent::render(); // TODO: Change the autogenerated stub
- }
- }
|