DataManager and dataStateChange event
I am using the DataManager in my Vue Syncfusion grid to accomplish On Demand data:
I need to do some work after each call to the DataManager URL. How can I do this?
Basically, every time the DataManager calls the URL with the SyncFusion grid parameters, I need to run some code on the resulting table. How can I accomplish this?
Thank you.
Hi Camille,
Greetings from Syncfusion support.
Based on your query, you want to perform some action on the response received from the server. Your requirement can be achieved by using the custom adaptor in which you can extend the URLAdaptor and perform your actions in the processResponse method.
Please refer the below documentation for more details.
Documentation: https://helpej2.syncfusion.com/vue/documentation/grid/data-binding/remote-data#custom-adaptor
Regards,
Joseph I.
Hi Jodeph,
This is close to what I need, but not exactly. I am now able to get extra data back from the URL like this:
The URL returns this data back to the Syncfusion class:
return Ok(new {
result = plateSearchViewModel.PlateCaptures,
count = plateSearchViewModel.TotalNumberOfRecords,
extraData1 = "test 1",
extraData2 = "test 2"
});
The problem now is that I don't know how to get the data our of the class and available on the front end vue app:
class CustomUrlAdaptor extends UrlAdaptor {
processResponse() {
//calling base class processResponse function
let response = super.processResponse.apply(this, arguments);
// HOW DO I GET THIS DATA OUT OF THIS CLASS AND ACCESSIBLE IN THE VUE FRONT END???
var newData1Result = response.newData1;
var newData2Result = response.newData2;
return { result: response.result, count: response.count };
}
}
Camille,
Before proceeding with the solution, share the below details.
- Complete grid rendering code.
- Share a video demo explaining your query.
- Simple sample for validating.
- Syncfusion package version.
- 3 Replies
- 2 Participants
-
CS Camille Sevigny
- May 31, 2023 06:59 PM UTC
- Jun 5, 2023 06:16 PM UTC