Comments (7)
Hi, Keeping in mind issue56 I would like to have an access to Grid state to use it in other component and which will re-render it when I save data in grid. How can I achieve this? Regards
Hi @Krugerro
If I understand correctly, you want to have access to Grid State(items in the Editable Grid) whenever you update something on the Grid.
Also, I am assuming by 'Save', you are referring to the action of updating something on the grid(without clicking the 'Submit' button).
Are these assumptions correct?
from fluentuieditabledetailslist.
Hi @kushalmehrotra713
You understood me well and your assumptions are correct.
from fluentuieditabledetailslist.
Hi @Krugerro
Please find the below PR that addresses this issue.
#73
Look for onGridUpdate function in GridConsumer.tsx to see how you consume the data from the callback. Dont forget to add onGridUpdate property when calling the Grid.
from fluentuieditabledetailslist.
Works like a charm after single row update and row add 👍. Fails when item is deleted: onGridUpdate is fired but in callback data is still same length (this attribute I tested) and other component does not re-render and data change is not reflected. Please check on this. Thanks.
from fluentuieditabledetailslist.
Works like a charm after single row update and row add 👍. Fails when item is deleted: onGridUpdate is fired but in callback data is still same length (this attribute I tested) and other component does not re-render and data change is not reflected. Please check on this. Thanks.
Hi @Krugerro
That is by design. You may want to filter the returned items by _grid_row_operation_ == Operation.Delete
in order to get the deleted rows.
Reason:-
When you delete an item in the grid, the Grid only does a 'soft delete' i.e. it just marks the _grid_row_operation_
attribute for that row to 'Operation.Delete'. It does not physically delete the row from the data structure. Because, as a user, when you delete the row from the grid, you may want to reconcile that same in the backend(if the data is powered from a backend). For that, you would need to send the identifier of the deleted rows to the backend. Hence, the returned rows contain the deleted rows as well, marked with 'soft delete'.
Now coming to your issue. As I understand, you may be re-rendering the other component based on the length of the current grid data. Instead of that, you can filter the grid data based on different Operations(Update, Add, or Delete) and use those to re-render the other component.
Hope this helps.
from fluentuieditabledetailslist.
That makes complete sense and I will use it while updating data in backend - thought I would have to "calculate" changes by my own now I see everything is included.
Thank you @kushalmehrotra713 very much for updates and explanation.
from fluentuieditabledetailslist.
Thanks @Krugerro
Glad that it helped. 💯
Closing the issue.
from fluentuieditabledetailslist.
Related Issues (20)
- Text selection HOT 6
- "CSV" Export Fails in SPFx in SharePoint Online outside of Workbench due to SharePoint link manipulation HOT 2
- column minWidth HOT 1
- Footer : onRenderItemColumn
- IColumnConfig "onRender" (derived from IColumn) kills "edit" functionality HOT 8
- OnRerender the items are not visible
- Clicking on "Bulk Edit" causes TypeError: Cannot read properties of undefined (reading 'setExtraStackFrame') | react-jsx-runtime.development.js | happens ONLY when serving my SPFx project in development mode HOT 4
- Column filter - automatic remove select all
- Freeze Actions Column as the first Column
- Style not being applied to columns
- Project still active?
- Selection is not working
- Selection is bound to row position but not the actual selected row
- Sorting on dataType 'date' is broken HOT 1
- Grouping items HOT 1
- Unable to extend command bar HOT 2
- Format date
- Modal "Column Filter" strange initial rendered components.
- xlsx vulnerablility in fluent editable grid
- Not loading items from Dataverse table within Power Apps Studio
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fluentuieditabledetailslist.