Comments (4)
Hey @mtr1990
This is not a bug in the data grid, but rather an implementation issue.
When selecting an item inside from the MultiSelect
it will cause a state change and therefore a re-render of the grid. You can prevent that by moving the state handling inside of the MultiSelect
component.
When you provide that to the toolbar
slot it does not re-render the whole grid with every change. This is also way more efficient.
Here is your example, but with an altered way of rendering the MultiSelect
: Multi-Select
example
I guess you will need the values set in the MultiSelect
for the grid, so you could then pass the values back when closing/bluring the MultiSelect
, or provide it through a global state management, etc.
I hope this helps! If not please feel free to ask! ๐ช๐ผ
from mui-x.
Hi @michelengelen ,
Thanks for responding and providing a solution.
My aim is to get the values โโfrom MultiSelect
and use this to filter data from the grid.
However, I don't know how to get these values โโexactly with the desired behavior of selecting multiple items in one go.
The global state appears ready to do this. But it wouldn't be suitable in my case. Do you have any other ideas or solutions?
https://codesandbox.io/p/sandbox/datagrid-forked-spsjsc?file=%2Fsrc%2FApp.tsx%3A61%2C8
from mui-x.
Hey @mtr1990
So, when you need the values set in the MultiSelect
component you can just pass a handler into the component that gets called in the onClose
or onBlur
method.
Here is a working example, logging the selected names in the console when the select closes.
This is where you can then update the filtering with the apiRef
from the datagrid.
Let me know if you need more help with this.
Thanks! ๐๐ผ
from mui-x.
Hi,
I think this is a limitation. The expected behavior is that the values โโchange on the select event (onChange
) instead of onClose
oronBlur
.
However I am satisfied with this solution. Thank you for your help!
from mui-x.
Related Issues (20)
- [charts] The tooltip should get a position option
- I have the following order, when will I be able to download my license key? HOT 1
- [data grid] valueFormatter doesn't show the updated value after processRowUpdate HOT 19
- [DateTimePicker] PickerField shows `0NaN` for year portion of formatted input field value when using Eastern Arabic numerals HOT 5
- [data grid] include rows / leaf nodes prop in custom aggregation callback HOT 1
- MUI DataGrid Pro - restoreState with Column dimensions and columnVisibilityModel ignores column dimensions HOT 1
- [pickers] Required field does not work as expected for DatePicker HOT 1
- NextJs Mui x-Charts Bar colors go black HOT 2
- Can't close (delete) Data Grid column filter if type = 'singleSelect', operator = 'is any of' HOT 2
- Module not found: Package path ./_lib/format/longFormatters is not exported from package date-fns in version v6.18.6 HOT 1
- [tree view] onBlur event causes TreeView performance issues
- Time picker default value in Mac OS HOT 1
- [pickers] When embedded inside iframe focus shifts to top of iframe when clicked HOT 7
- [docs] Add Pickers RTL support section
- [data grid] Input type number lets type non number. HOT 8
- [pickers] `MultiSectionDigitalClock` incorrect RTL behavior HOT 6
- [data grid] Filtering on non filterable columns yield weird behavior
- [tree view] Polish the look and feel HOT 1
- [data grid] Autosizing does not adjust when an individual column's width is set by the user HOT 3
- MuiPickersFadeTransitionGroupRoot: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead. HOT 6
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.