-
-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Grid Filters for Grid with source arrayProvider Not working #62
Comments
That should work. I can apply filters to grids with an array source. I'll have too look into this. |
Hey @Vinai I think I found the problem.
The problem here is, that Locally I solved it with a quick and dirty patch, adding a --- Model/GridSourceType/ArrayProviderGridSourceType.php
+++ Model/GridSourceType/ArrayProviderGridSourceType.php
@@ -136,9 +136,9 @@
*
* @return RawGridSourceContainer
*/
- public function fetchData(SearchCriteriaInterface $searchCriteria): RawGridSourceContainer
+ public function fetchData(SearchCriteriaInterface $searchCriteria, bool $forceRefresh = true): RawGridSourceContainer
{
- if (!isset($this->memoizedGridData)) {
+ if ($forceRefresh || !isset($this->memoizedGridData)) {
$provider = $this->arrayProviderFactory->create($this->arrayProviderClass);
map(function (HyvaGridSourceProcessorInterface $processor) use ($provider, $searchCriteria): void {
@@ -177,7 +177,7 @@
private function getFirstRow(): array
{
$searchCriteria = $this->searchCriteriaBuilder->setPageSize(1)->setCurrentPage(1)->create();
- return values($this->gridSourceDataAccessor->unbox($this->fetchData($searchCriteria)))[0] ?? [];
+ return values($this->gridSourceDataAccessor->unbox($this->fetchData($searchCriteria, false)))[0] ?? [];
}
public function extractTotalRowCount(RawGridSourceContainer $rawGridData): int
|
Hi renttek I am also trying to add the filter with the same process as adding below filter .
Thanks |
Hi,
I am making a Hyva grid with
source
asarrayProvider
and have givenfilters
tag in the XML file like followingthe filters are showing on the grid they aren't working. Is this how we add filters to the grid with the
source
asarrayProvider
or am I missing something.Thanks.
The text was updated successfully, but these errors were encountered: