Skip to content

Commit

Permalink
Add default datatables method in config
Browse files Browse the repository at this point in the history
  • Loading branch information
daaner committed Feb 16, 2023
1 parent 82b5300 commit f5f5f3a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# [Unreleased] (Only in SleepingOwl <code class="language-php">8+</code> branch)

## 2023-03-14
## 2023-02-16
* [Add] Add default datatables send method in config `default_datatables_method`

## 2023-02-14
* [Add] Add new method for display datatables `->setMethod('POST') // по умолчанию GET так и остался`

## 2023-02-08
Expand Down
7 changes: 7 additions & 0 deletions config/sleeping_owl.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,13 @@
*/
'state_datatables' => true,

/*
* --------------------------------------------------------------------------
* Default DataTables send method.
* --------------------------------------------------------------------------
*/
'default_datatables_method' => 'GET',

/*
* --------------------------------------------------------------------------
* Tabs state remember.
Expand Down
3 changes: 2 additions & 1 deletion src/Display/DisplayDatatablesAsync.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public static function registerRoutes(Router $router)
/**
* @var
*/
protected $displayMethod = 'GET';
protected $displayMethod;

/**
* DisplayDatatablesAsync constructor.
Expand All @@ -82,6 +82,7 @@ public function __construct(string $name = null, string $distinct = null)

$this->setName($name);
$this->setDistinct($distinct);
$this->displayMethod = config('sleepingowl.default_datatables_method', 'GET');

$this->getColumns()->setView('display.extensions.columns_async');
}
Expand Down

0 comments on commit f5f5f3a

Please sign in to comment.