Giter Site home page Giter Site logo

Comments (9)

aestradaes avatar aestradaes commented on August 15, 2024 2

@michelengelen

Hey thanks for your response! We do use processRowUpdate in our data grid, but are unable to use it how we want.

I made a live code example here. Ive made it so the request take a while to save so its easier to test.

So what I want to happen is when a user makes a change to Name and they press Enter (or click out of the cell) to save. I want the entire row to be completely disabled for editing.

In my live code example if you choose a row:

  1. Change Name
  2. Press Enter
  3. You can still edit Country (and save by pressing enter) within the same row

Now we have 2 Post calls waiting. Which we don't want. Hopefully this example is better, thanks!

from mui-x.

michelengelen avatar michelengelen commented on August 15, 2024 2

@MBilalShafi This is an interesting use case ... could you assist here?

from mui-x.

aestradaes avatar aestradaes commented on August 15, 2024 2

This is one of the solutions I tried (I used redux in our application to keep track of the current id being edited to test the concept). But if you follow the steps above or try re-editing the same cell by spamming enter it breaks (sometimes). Heres a screenshot of the error with this solution I tried
Test Cell Editable Fail It crashes the page. Thats why I think it would be nice to be able to disable the row (and grey the row out as an indicator) right after they press enter/click out the row to save their changes.

from mui-x.

MBilalShafi avatar MBilalShafi commented on August 15, 2024 2

Would this be more in line with a feature request?

I'd say yes. There doesn't seem to be an easy way to achieve your use case out of the box.

To me, this makes sense along with the data source implementation around the edit feature, but it could also be done separately since it corresponds to the server-side synchronization part of the row editing.

Until we pick this up, I'll add a Waiting for upvotes 👍 label to see demand for it in the community. Feel free to add an upvote on the issue description.

from mui-x.

aestradaes avatar aestradaes commented on August 15, 2024 1

@MBilalShafi Thanks!

from mui-x.

michelengelen avatar michelengelen commented on August 15, 2024

This is something that can be done with the processRowUpdate method.
Here are the docs for that: The processRowUpdate method

I am not sure though what your exact needs are. Could you elaborate a bit on what you want to achieve?

from mui-x.

michelengelen avatar michelengelen commented on August 15, 2024

Ideally we would like to see a live code example to work with. 👍🏼

from mui-x.

MBilalShafi avatar MBilalShafi commented on August 15, 2024

@aestradaes Have you already tried using the loading prop to prevent users from updating rows during the API call?
One drawback could be that it will block the rest of the rows during the update too.

from mui-x.

aestradaes avatar aestradaes commented on August 15, 2024

@MBilalShafi I have tried that, but it blocks the rest of the rows like you said. For me in line row editing is basically some sort of a form. And like other forms, when you submit I would like to grey the inputs until the post is finished. Unfortunately it seems there isn't an easy way to do what I am asking. Would this be more in line with a feature request?

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.