Comments (6)
@michelengelen Thanks for taking a look. I agree about the documentation, and the how the name should probably be isRowEditable
. Furthermore, there is no apparent way to pass in a field name to indicate which cell to disable.
Is there any kind of work-around to make an individual cell non-editable under certain conditions? In the column definition, there is an editable
property, but I do not see a way to set it programmatically.
from mui-x.
Hey @mdrake411 I can confirm this is a bug. Thanks for raising this!
@cherniavskii I'll add this to the board, so we can have a look.
As it seems the description in the docs is also a bit misleading.
It clearly states that isCellEditable
can be used to define which individual cells are editable,
You can use the isCellEditable callback prop to define which individual cells the user can edit in a given row.
but in the last section it says that the entire row will be disabled when the callback returns false
.
In the following demo, only the rows with an even Age value are editable. The editable cells have a green background for better visibility.
When this is intentional we should rename the prop to isRowEditable
and adjust the description as well.
WDYT?
from mui-x.
Additional thoughts... if one result of this bug will be to change the name from isCellEditable
to isRowEditable
, then there should be a corresponding way to disable the edit button in an action column with GridActionsCellItem
elements. Otherwise, It could be potentially confusing for a user to click an edit button, have the row turn into edit mode, and not be able to edit any columns.
from mui-x.
Just encountered this error in my code 😄 Can I fix this?
from mui-x.
@michelengelen , @cherniavskii , some of mdrake411's comments suggest that isCellEditable
should be replaced with controlling editable at the row level only.
However, I can see a lot of use cases when we might want to block just a single cell from being edited, in particular in cases like:
- the current user does not have permissions to edit this field
- the row represents a deleted/archived entity hence some of the properties should not be altered anymore
- some types of rows should allow editing only a subset of cells
from mui-x.
@czerwinskilukasz1 I did not mean to suggest that "isCellEditable should be replaced with controlling editable at the row level only". I was only making the observation that currently it appears that is what it does, despite its property name.
I agree with your use cases, and I have one similar use case. I need the a row to remain editable while a particular cell in that row is not editable depending on the value of another cell in that same row. I believe that would be more representative of the property name.
from mui-x.
Related Issues (20)
- [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
- [DateTimePicker] Can't change the color for the tabs HOT 8
- [fields] DateField component return invalid dates for the LT and PL locale with format LL HOT 2
- [charts] order of tooltip is not in the same order like a stacked bar chart HOT 4
- [pickers] Option for abbreviated or wide for month view HOT 4
- [DataGrid] Option to open filter menu under the specific column in Data Grid HOT 1
- [data grid] Enable grid selectors to access props
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.