Closed AnitaMartinez closed 2 years ago
+1
That's a bit tricky. The components.BasePopper
only override when the data grid is using <Popper/>
Here it is a <Select/>
which internally uses the Popper
. So you can pass props to the Select
but not the Popper
inside the Select
For your use case, what would you think about removing the option? The valueOptions
can be a method that renders options depending on the row.
Here is a demo where deleted is in the filter, but not the rows https://codesandbox.io/s/styling-options-single-select-forked-bx5oh6?file=/src/App.tsx
valueOptions: ({ row }) =>
row === undefined
? ["active", "deleted", "inactive"]
: ["active", "inactive"]
Thanks! It works now 🚀
Is there way to style the cell not it edit mode? meaning i want to user will understand that the cell is dropdown. because now the user should double click on the cell to get the value options
(without using rendercell )
Duplicates
Latest version
Current behavior 😯
I am struggling to find a way of styling the select options in the edit mode of a cell within the Datagrid.
I have used the
sx
property in the popper component usingcomponentsProps.basePopper
, but it does not work.Expected behavior 🤔
I was wondering if there is a way to style the options of the single select within the Datagrid without having to create my own edit component.
Steps to reproduce 🕹
CodeSandbox
Context 🔦
This problem has arisen because I would like to hide or disable one of the select options (in this case, "deleted"). I can't remove it directly from the
valueOptions
incolDef
because I need that option to show up in Filters.Your environment 🌎
``` Browsers: Chrome: 103.0.5060.53 Firefox: 100.0.2 Safari: 14.0.1 ```npx @mui/envinfo
Order ID 💳 (optional)
No response