Browse Source

删除菜单自动刷新页面

jqh 4 năm trước cách đây
mục cha
commit
fb31201773
1 tập tin đã thay đổi với 6 bổ sung1 xóa
  1. 6 1
      src/Tree/Actions/Delete.php

+ 6 - 1
src/Tree/Actions/Delete.php

@@ -8,8 +8,13 @@ class Delete extends RowAction
 {
     public function html()
     {
+        $url = request()->fullUrl();
+
         return <<<HTML
-<a href="javascript:void(0);" data-message="ID - {$this->getKey()}" data-url="{$this->resource()}/{$this->getKey()}" data-action="delete"><i class="feather icon-trash"></i>&nbsp;</a>
+<a href="javascript:void(0);" 
+    data-message="ID - {$this->getKey()}" 
+    data-redirect="{$url}"
+    data-url="{$this->resource()}/{$this->getKey()}" data-action="delete"><i class="feather icon-trash"></i>&nbsp;</a>
 HTML;
     }
 }