Asking on behalf of customer: I have a data grid within my reactive web app. I use a client action to write changes to the data grid back to my on-prem SQL database when a cell in the grid changes. My client action is the handler for the OnCellValueChange event in one of my number columns. Below is the client action.
The client action above is correctly being triggered whenever I change a cell in my grid. The issue occurs when I click within the same row or hit 'tab' after changing the cell. The client action is triggered, but the 'GetChangedLines' widget in my action does not recognize a changed cell until I click off that row. Is there a way I can alter the 'GetChangedLines' to pick up a changed row whenever a cell is changed, regardless of the action taken afterward? Thanks in advance.
Hi, @Matt Geiger!
The Tab key behavior is a default behavior from the provider. You can check it here.
However, we have a workaround for this use case. To fix that issue with the change not being committed when clicking in a cell in the same row, you need to add this piece of code in the GridOnInitialize event:
var grid = OutSystems.GridAPI.GridManager.GetActiveGrid();grid.provider.cellEditEnded.addHandler(() => { grid.provider.itemsSource.commitEdit();});
To make the GetChangedLines Action to work inside the OnCellValueChange event, you need to add a setTimeOut to the OnCellValueChange Client action calling the action. For example:
setTimeout(() => { $actions.GetChanges()}, 0);
I am attaching the OML with this workaround implemented.
Regards,
Giuliana.
Hello @Matt Geiger
After reaching Wijmo's FlexGrid support, they confirmed that the current design is that if we interrupt editing with the tab key, the value is not considered finalized, so for now we can't provide you a way to achieve that.However, since this makes sense to us from a product standpoint, we've created an investigation task (ROU-4588 for future reference in the release notes) in order to try to implement that behaviour (a workaround) on top of Wijmo's FlexGrid, but we can't provide any ETA at this point.
Cheers,GM
Hi @Matt Geiger,
This is a issue and we could reproduce on our environment. However, the issue occurs on the provider's end. We'll contact them and see if there's a workaround for it, but we can't promise anything right now.
In the meantime, you can see what changed in that cell by looking at the "OldValue" and "NewValue" parameters in the "OnCellValueChange" event.
Best regards,
Bernardo Cardoso
@Gonçalo Martins thank you for the update! We will continue to look for options and watch this thread as well.
Thank you @Giuliana Silva ! @Samuel Kalman have you seen this workaround?