Skip to content
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

Allow coexistence of both outer and column filters #1103

Closed

Conversation

survik1
Copy link

@survik1 survik1 commented Oct 18, 2023

Hello, we are using Datagrid on quite large project with millions of records. And we have currently reached some limitations that causes us some issues.

We would like to create the grid overview of the users. We have currently about 800k business users. Each user can have n invoicing addresses among others (same can be applied to more records, like contacts, delivery addresses and so on). The grid displays only data from user (other entities are accessible through user detail). We need, however, to filter users based on data in their subentities. The example could be a user calling to callcenter providing their ID number (IČO) which is attribute of invoicing address.

Datagrid allows us to use either column filters or outer filters. Keeping the columns would require to add column with ID values (probably using GROUP_CONCAT(DISTINCT)). Using outer filters would allow to add the filter we require, but it would also move all filters from columns, which isn't the desired operation as column filters are very useful.

This PR moves rendering decision down to filter instead of keeping it on DataGrid level. The change allows to keep column filters while also add a possibility to create a detached filter that would only be added to the section over the grid. The code and its execution should be compatible with previous version, so is should be safe to deploy within next minor version.

Example:

$grid->addFilterText('ico', 'IČO')
    ->setOuterRendering()
    ->setCondition(function (Fluent $fluent, $value): void {
        if ($value) {
            $fluent->where([['invoice_address.ic = %i', $value]]);
        }
    });

@survik1
Copy link
Author

survik1 commented Dec 6, 2023

Hello, can i get like any reaction?

@dakorpar
Copy link
Member

dakorpar commented Dec 6, 2023

I like it, @f3l1x WDYT?

@survik1
Copy link
Author

survik1 commented Jan 30, 2024

Hey guys, are you still working on this? I understand that the eventual merging may take time, but not responding is really bad sign to me.

@dakorpar
Copy link
Member

@paveljanda @f3l1x ...

@survik1
Copy link
Author

survik1 commented Apr 23, 2024

@paveljanda @f3l1x Alright guys, we are quite pilling up on fixes and updates and since this small PR can't even get any attention even in the form of "will check it out later in 2025", we will not bother bringing the other changes and just continue with the fork of the library. Thank you @dakorpar for at least your replies.

@survik1 survik1 closed this Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants