Coder Social home page Coder Social logo

Comments (3)

kushalmehrotra713 avatar kushalmehrotra713 commented on May 17, 2024

Hi @akgitrus
Thanks for pointing out the bug regarding column onChange. I have just checked-in the code to add support to other EditableControlType types like Dropdown, Date & TagPicker. For the implementation, please check the commented code in 'attachGridValueChangeCallbacks' function in gridconsumer.tsx file. Do let me know if this solves your issue.

Regarding your second question for onChange, column level onChange is just meant to be a callback when the user is making any live changes, where it sends you back the live changes in grid data, even if the user hasnt saved those. This implementation was provided to give control to the user to implement their custom functionality on the grid data if need be.
An example of that would be 'Showing Summation of any number column'. In this case, user may want the summation to be live as he/she edits the values in the number column.

As for your requirement, where you need to push values to backend, column level onChange will not be the right choice.
What you need is 'onGridSave' callback function. You can check the implementation for the same in onGridSave function in gridconsumer.tsx file.

onGridSave gets fired when the user clicks on the 'Submit' button in the grid. The function callback receives entire Grid data. If you need to identify the rows that you have updated, you can use 'grid_row_operation' property in the data like this:-
data.filter(item => item.grid_row_operation == Operation.Update)
Same way you can filter for both Added and Deleted rows as well.

I have updated the onGridSave function to show these implementations as well.

You can refer the same in this PR:-
#48

Please do let me know if this solves your problem.

from fluentuieditabledetailslist.

akgitrus avatar akgitrus commented on May 17, 2024

Hi Kushal, thank you for quick response and fix! I think it solves my current issue.

Regarding the column's onChange - it is more clear now after your explanation. But consider my idea, may be for future releases, - I didn't want to use the "Submit" button at all - to make the UI more concise and save changes on-the-fly as the user make their input.

Anyways, now I'm ok. Thanks again, appreciate your help.

from fluentuieditabledetailslist.

kushalmehrotra713 avatar kushalmehrotra713 commented on May 17, 2024

Hi Kushal, thank you for quick response and fix! I think it solves my current issue.

Regarding the column's onChange - it is more clear now after your explanation. But consider my idea, may be for future releases, - I didn't want to use the "Submit" button at all - to make the UI more concise and save changes on-the-fly as the user make their input.

Anyways, now I'm ok. Thanks again, appreciate your help.

Hi @akgitrus . Point taken. I can consider adding that functionality based on a configuration. May be not triggering onGridSave callbacks as and when the user is typing but when the user is done with on-the-fly changes and wants the grid to auto-reconcile(i.e. without having to explicitly click on the 'Submit' button). Thanks for the feedback.

Since your issue is resolved, I'll close this thread but do feel free to open more issue threads as and when you face any challenges and I can help resolve those. Thanks.

from fluentuieditabledetailslist.

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.