[Data Grid Reactive] Delete cell content with delete key
Forge component by Bruno Martinho
Application Type
Reactive

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.

Hello @Daniel Figueira,

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.

Best regards,

Tiago Pereira

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.