Skip to content

Commit 0083a49

Browse files
committed
Implement basic whereIn search panes.
Relationships not yet supported.
1 parent 632b4b4 commit 0083a49

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/DataTableAbstract.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -663,9 +663,28 @@ protected function filterRecords()
663663
}
664664

665665
$this->columnSearch();
666+
$this->searchPanesSearch();
666667
$this->filteredRecords = $this->isFilterApplied ? $this->filteredCount() : $this->totalRecords;
667668
}
668669

670+
/**
671+
* Perform search on submitted search panes.
672+
*/
673+
protected function searchPanesSearch()
674+
{
675+
$columns = $this->request->get('searchPanes');
676+
677+
foreach ($columns as $column => $values) {
678+
if ($this->isBlacklisted($column) && ! $this->hasFilterColumn($column)) {
679+
continue;
680+
}
681+
682+
$this->getBaseQueryBuilder()->whereIn($column, $values);
683+
684+
$this->isFilterApplied = true;
685+
}
686+
}
687+
669688
/**
670689
* Perform global search.
671690
*

0 commit comments

Comments
 (0)