Code Monkey home page Code Monkey logo

Comments (6)

silvialeung-mh avatar silvialeung-mh commented on July 18, 2024 3

@cherniavskii Thank you. This will satisfy the current use case and it would be great if this feature can be included in v6

from mui-x.

cherniavskii avatar cherniavskii commented on July 18, 2024 2

Hi @silvialeung-mh
I've opened a PR for it #12225
You can check out the demo here: https://deploy-preview-12225--material-ui-x.netlify.app/x/react-data-grid/clipboard/#events
Is this what you're looking for?

Also, do you need this for the v6 of the data grid?

from mui-x.

michelengelen avatar michelengelen commented on July 18, 2024 1

Ah, yes ... I am sorry. I did not check that beforehand. Sry! 🙇🏼

As it stands the problem is that the onClipboardPasteStart method can only be used to implement side-effects, which is not what I would expect from an event-handler.

I would propose a solution for this to prevent execution based on the return value of onClipboardPasteStart, or even make the method a Promise that will only execute the paste on resolve() and otherwise abort, but it is a breaking change.

WDYT @MBilalShafi @cherniavskii ?

from mui-x.

michelengelen avatar michelengelen commented on July 18, 2024

Hey @silvialeung-mh ... yes, you can achieve something like this if you prevent execution of processRowUpdate with a combination of await, Promise and events. I did play around with this a bit and this is what I came up with: Paste operation Dialog

This example is pretty basic, so you might want to extend it a bit and tailor it to your specific implementation! Let me know if this helps you! Thanks! 🙇🏼

from mui-x.

silvialeung-mh avatar silvialeung-mh commented on July 18, 2024

Hi @michelengelen , thanks for the quick response. I played around with the sandbox you have provided but it seems to have affected normal edit as it is now waiting for 'dialog-action' event and I am not sure where to dispatch it in normal edit flow (because onCellEditStop runs before processRowUpdate).

from mui-x.

github-actions avatar github-actions commented on July 18, 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 @silvialeung-mh?
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.