Hello,
Is there any way of deleting the content of a cell using the delete key ?
I've tried in text column and it works but it doesn't work in the other column types.
I would like to have it working for the number columns at least.
Thank you!
Hello @Daniel Figueira,
At the moment, that configuration is not available on the DataGrid component and you will only be able to activate it with a workaround.
In order to be able to clear a cell from the grid with the delete key, the column must have the property isRequired set to False (set by default by Wijmo to "Text" columns but not the remaining ones), right now that configuration is not available on the DataGrid component. Nevertheless, you will be able to set it with JS.
For further information about that property, you can have a look at the property isRequired on Wijmo's documentation.
---------------
Right now, I would suggest the following workaround:
Add an onReady client action to the Screen. Inside, you might want to add JavaScript just like in the image below.
Code-------------------------------------------------------------
GridAPI.GridManager.Events.Subscribe(
$parameters.GridId,
ExternalEvents.GridEventType.Initialized,
function (gridId, gridObj) {
gridObj.getColumn('Sample_Product.Price').provider.isRequired = false;
}
);
---------------------------------------------------------------------
Hope this answer is useful.
Best regards,
Tiago Pereira
Hi,
Thank you, it works.
I'm glad it worked for you.
Please bear in mind that we didn't make all the necessary tests to ensure that it will work on all cases. We are continuously working to provide more API methods, so I suggest you keep tuned, as we intend to launch new events that might replace the code that I provided in my previous answer in order to make it easier to custom such behaviors.
I am getting the following error when I attempt this. Can you tell me what I am doing wrong/what dependencies I am missing?
I followed the instructions here and it worked.https://www.outsystems.com/forums/discussion/70807/outsystems-data-grid-externalevents-is-not-defined/New code I used:
GridAPI.GridManager.GetGridById($parameters.GridWidgetId).getColumn...