Skip to content

Commit 8112057

Browse files
committed
Patch DataTables handling of infinite page length
1 parent 6d6b53e commit 8112057

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/DataTableState.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ public function applyParameters(ParameterBag $parameters): void
8989
$this->start = (int) $parameters->get('start', $this->start);
9090
$this->length = (int) $parameters->get('length', $this->length);
9191

92+
// DataTables insists on using -1 for infinity
93+
if ($this->length < 1) {
94+
$this->length = null;
95+
}
96+
9297
$search = $parameters->all()['search'] ?? [];
9398
$this->setGlobalSearch($search['value'] ?? $this->globalSearch);
9499

0 commit comments

Comments
 (0)