Code Monkey home page Code Monkey logo

Comments (7)

DanailH avatar DanailH commented on July 22, 2024 1

@scamden I've added it for today's grooming session so we can discuss and see how to proceed.

from mui-x.

DanailH avatar DanailH commented on July 22, 2024

@JohannesByle the problem is not with the property itself but rather the way you control it. In order to change column configuration once the grid is initially loaded you need to use apiRef.current.updateColumns method. This is explained in the docs here https://mui.com/x/react-data-grid/column-definition/ (right below the first example).

from mui-x.

JohannesByle avatar JohannesByle commented on July 22, 2024

Thanks for the quick response. I had read that section of the docs, but because the two different columns behaved differently I assumed it was a bug.

In my case I have props that control whether or not a column is editable. Would the correct approach be to update the columns in a useEffect like this?

  const {editable} = props;

  useEffect(() => {
    const cols = baseCols.map((c)=> ({...c, editable}));
    apiRef.current.updateColumns(cols);
  }, [editable]);

from mui-x.

JohannesByle avatar JohannesByle commented on July 22, 2024

After doing further testing it looks like it's broken for the apiRef.current.updateColumns as well:
https://codesandbox.io/s/interesting-wiles-mr5vx5?file=/src/demo.tsx

from mui-x.

DanailH avatar DanailH commented on July 22, 2024

Ah ok, I can confirm, It doesn't seem to be working.

from mui-x.

scamden avatar scamden commented on July 22, 2024

this is a fairly huge bug.. any update on progress?

from mui-x.

cherniavskii avatar cherniavskii commented on July 22, 2024

This is a regression from #9334

v6.9.2: https://codesandbox.io/s/shy-wildflower-xqzpqp
v6.10.2: https://codesandbox.io/s/angry-david-ncrxph

The relevant change is here: https://github.com/mui/mui-x/pull/9334/files#diff-d6677e3149e60f2ede0c6ad76a8014630705d0668b5d8c92284a8e643d75a145

from mui-x.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.