Using OnActionBegin vs CustomAdaptor

Hi

this question isnt for a specific requirement but a general question on how to do things.

Can you explain when I should use the OnActionBegin event for crude operations and when I should build a custom adaptor for this?

3 Replies 1 reply marked as answer

JP Jeevakanth Palaniappan Syncfusion Team March 22, 2021 10:17 AM UTC

Hi Simon, 

Greetings from Syncfusion support. 

We have checked your query and you can use the OnActionBegin event of the grid to customize the default grid CRUD operation. Like below 

  1. To cancel the current action based on the Request type by specifying the args.Cancel as true
  2. If you want to modify a particular grid data (eg: ShipCountry) based on other field(eh: ShipCity)

You can use the Custom Adaptor if you want to handle the CRUD operation on your own. Please refer the below documentation for your reference. 


Regards, 
Jeevakanth SP. 


Marked as answer

SB Simon Balling March 23, 2021 06:41 AM UTC

Thanks. That helps me.

One question about custom adaptor:

When specifying a Datasource I can access it by accessing the List I put the data in.
When using a custom adaptor i dont specify the datasource (correct?) but give the grid its data via the adaptor.

How do I access the Datasource when using a custom adaptor? I know how to access the datamanager but i dont seem to be able to access the data.


JP Jeevakanth Palaniappan Syncfusion Team March 24, 2021 05:28 AM UTC

Hi Simon, 

If you have a separate list or fetched the data in the OnInitialized as like we have used Orders in the OnInitialized method, then you can use the same. 


If you still face any difficulties then kindly share us the grid rendering code and the CustomAdaptor class so that we can able to provide solution based on your scenario. 

Regards, 
Jeevakanth SP. 


Loader.
Up arrow icon