Comments (8)
In order to understand your use case better, please provide a minimal reproduction test case with the latest version. This would help a lot π· .
A live example would be perfect. This codesandbox.io template may be a good starting point. Thank you!
from mui-x.
Hey @dendycodes
Interesting use case!
When a user applies a filter on the main data grid (e.g., by Course), the filtering should not only consider the main grid data but also the data from the detailed rows (child grid or expanded details).
Could you expand a little bit more on this?
What filter criteria would you want to apply to the nested data grid when filtering the root data grid by course?
Are the data for the nested data grid part of the row
object?
from mui-x.
In the main row, we have details pertaining to learners. In the sub-table, I wish to display a list of courses that each learner has either successfully completed or is still in the process of completing.
The data for the nested data grid is not a part of the main row object. Instead, the master-detail grid represents a completely different table, which is fetched using the main row's learnerID or id.
I aim to filter learners based on the courses. For example, if a learner is enrolled in "Course A," I would like to be able to filter and display only those learners who are enrolled in "Course A."
from mui-x.
Hi @dendycodes, thanks for providing the details.
I am a bit lost with the scenario tbh.
Could you explain a bit more about how exactly you want the filters to work? For example, you add a filter on First name
column from the root grid. Shouldn't that work only on the first name column as it's a column filter?
Or do you more specifically refer to the quick filter? In that case, you may want to use controlled filterModel
by saving the filterModel.quickFilterValues
for the root grid in a variable and pass it on to the nested grids.
Does it make sense?
from mui-x.
Hi @MBilalShafi,
Currently, the filter options available in the root grid are limited to its own columns. However, I would like to enhance this functionality by including columns from the nested grid within the root gridβs filter options. This way, users will be able to apply filters based on the data present in the columns of the nested grid.
I would greatly appreciate your guidance on how to achieve this integration, ensuring a seamless user experience.
Thank you in advance for your time and support.
from mui-x.
Hi @MBilalShafi here is the minimal production case - https://codesandbox.io/s/data-grid-community-forked-wdv522?file=/src/App.tsx
For example, I have two tables: 1) the main table, and 2) the nested table.
The main table contains three columns: 'ID', 'Learner Name', and 'Age'. The nested table includes two columns: 'ID' and 'Course Name'.
The feature I need to build will enable users to filter learners by 'Course Name' in combination with 'Learner Name' and 'Age' from the main table.
In other words, how can I add 'Course Name' as a filter option to the main table?
from mui-x.
There isn't a direct way to achieve this since the external grid doesn't recognize the course name column.
IMO, this seems a more valid use-case of rowGrouping
rather than master detail. I was wondering if you could use rowGrouping
here instead of master-detail to achieve the behavior you are trying to achieve, I've tried to update the codesandbox example: https://codesandbox.io/s/data-grid-community-forked-cx3w4k?file=/src/App.tsx
from mui-x.
The issue has been inactive for 7 days and has been automatically closed. If you think that it has been incorrectly closed, please reopen it and provide missing information (if any) or continue the last discussion.
from mui-x.
Related Issues (20)
- [data grid] How do I get the count of filtered rows on initial load when I have an initial state? HOT 3
- [DataGrid] Treedata event listener for group collapse/expand HOT 2
- [DataGrid] Treedata expand/collapse does not trigger onRowClick-Event HOT 8
- [data grid] columnVisibilityModel breaks `Show all` and `Hide all` buttons in manage columns overlay HOT 14
- [data grid] event for popup open/close missing for pageSize popup HOT 3
- [data grid] Row or column reordering doesn't work in Chrome 120 on Linux Wayland HOT 13
- [question] I have a question about automatic data trimming. HOT 2
- [data grid] `checkboxSelection` Prop Behavior in MUI X DataGrid HOT 4
- [pickers] `DateTimePicker` with hook form does not validate disablePast HOT 2
- [data grid] Expired key in production HOT 1
- [data grid] Dragging a row item beyond the screen scrolling is not functioning as expected on Mac OS HOT 3
- [DataGrid] Filter component oveflows grid (not responsive) HOT 2
- [DateTimePicker] Add column labels to DateTimePicker DigitalClock HOT 5
- [charts] Pie chart tooltip runtime warning HOT 23
- [data grid] Pinned column header glitch HOT 3
- [data grid]: Infinite Re-render when adding custom Data Grid Row HOT 1
- MUI X Pro Data Table Custom Pagination HOT 2
- [datagrid] Add typing to slot props HOT 10
- Seeking guidance on Autocomplete navigation behavior to prevent looping between first and last options
- [question] Problems with Pinned columns hover delay HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mui-x.