Quick Edit Mode Change is not working

Hello Syncfusion team, 

I am currently facing a problem with the syncfusion grid edit modes. I am trying to offer the user different edit modes at the same time with different toolbar items. 

So - without the user having to change settings all the time - I want to have an "Edit" and a "Dialog Edit" toolbar item and based on which item has been chosen, I want to change the edit mode and start the edit then. 

But this does not seem to work. 

Have a look at the following stackblitz:

https://stackblitz.com/edit/syncfusion-angular-editable-grid-bhxxgn?file=app.component.html

When I click on the DialogEdit the first time, it does not seem to trigger the mode change fast enough leading to the error Cannot read properties of null (reading 'querySelector') and stopping the edit mode.

Why is that the case? And is it possible to implement this quick mode change somehow?

Thanks in regard
Jonas!


3 Replies 1 reply marked as answer

JC Joseph Christ Nithin Issack Syncfusion Team November 25, 2022 11:09 AM UTC

Hi Jonas,


   Greetings from Syncfusion support.


   Based on your query, your are trying to change the edit settings to dialog edit and start the edit when you click the custom toolbar button, but when you click the dialog edit button, you are getting script error. On inspecting the code example, you have called the `startEdit` method directly after setting the edit mode. This is the reason you are facing the issue, we suggest you to call the `dataBind` after setting the edit mode, on calling this method, the pending property changes will be immediately applied to the component. Refer the below documentation.


Documentation: https://ej2.syncfusion.com/documentation/api/grid#databind


Regards,

Joseph I.


If this post is helpful, please consider Accepting it as the solution so that other members can locate it more quickly.


Marked as answer

JC Jonas Czeslik November 25, 2022 11:13 AM UTC

Thanks a lot! Thats exactly what I needed!



SG Suganya Gopinath Syncfusion Team November 27, 2022 12:42 PM UTC

Jonas,

We are glad that the provided solution worked. Please get back to us for further assistance.

We are marking this ticket as solved.

Regards,

Suganya Gopinath.


Loader.
Up arrow icon