Giter Site home page Giter Site logo

Comments (10)

Zasheus avatar Zasheus commented on July 22, 2024 1

Hey @cherniavskii, thanks a lot for that. I managed to get the implementation I wanted through the help of your demo. Let me know if there's a more elegant solution to this though πŸ˜‚ https://stackblitz.com/edit/react-u9chwq-ypaysx?file=Demo.tsx

from mui-x.

michelengelen avatar michelengelen commented on July 22, 2024

I am not sure I do understand you requirement.
From what I understood setting the editMode to 'row' would be what you want.
If you need 'non-editable' cells you can just disable that in the column definitions, or by using the isCellEditable method. That one is highly customizable to fit your specific needs as well.

Exmaple:

const isCellEditable = (params: GridCellParams) => {
  if (params.field === 'age' && params.value < 25) {
    return false;
  }
  return true;
};

from mui-x.

Zasheus avatar Zasheus commented on July 22, 2024

Essentially I have a cell where I can enter a code, and from that code I fetch data and set column data onProcessRowUpdate. This works as I expect since it’s in cell edit mode. However, in row edit mode, the fetch data will only populate once I exit out of editing the WHOLE row, rather than that specific cell.

So if I were to be able to get the tabbing functionality of row edit mode, but all the processes handle the same way as cell edit mode, this would be ideal.

from mui-x.

michelengelen avatar michelengelen commented on July 22, 2024

Oh, that's an interesting use case. @romgrk is it possible to update cell values "mid-edit"?

from mui-x.

romgrk avatar romgrk commented on July 22, 2024

I don't think so, that's a new feature or change we'd need to make.

How about we add a processCellUpdate callback to complement processRowUpdate?

@mui/xgrid Thoughts?

from mui-x.

michelengelen avatar michelengelen commented on July 22, 2024

Sounds like a good idea, but how can that help with this specific use case?
He would still need to exit edit mode, update and then re-enter edit mode if i understood that correctly

from mui-x.

cherniavskii avatar cherniavskii commented on July 22, 2024

Hi @Zasheus
I've forked and modified the single-click editing demo: https://stackblitz.com/edit/react-u9chwq?file=Demo.tsx
Is this the behavior you're looking for?

from mui-x.

cherniavskii avatar cherniavskii commented on July 22, 2024

@Zasheus Looks good to me!
While it's quite verbose, I don't have a more elegant solution, unfortunately.

from mui-x.

michelengelen avatar michelengelen commented on July 22, 2024

Thanks @cherniavskii for the confirmation. Since this seems resolved I will close the issue now. @Zasheus feel free to reopen if you encounter any problems with the solution! Thanks!

from mui-x.

github-actions avatar github-actions commented on July 22, 2024

⚠️ This issue has been closed.
If you have a similar problem, please open a new issue and provide details about your specific problem.
If you can provide additional information related to this topic that could help future readers, please feel free to leave a comment.

How did we do @Zasheus?
Your experience with our support team matters to us. If you have a moment, please share your thoughts through our brief survey.

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.