Hi Andrejs,
Greetings from Syncfusion support.
Based on your query, We could see that you have using DataManager instances to bind the dataSource, if so we would like to let you know that we have built-in support for data Adaptors UrlAdaptor , WebApiAdaptor, etc., and each adaptor uses different way in accepting request and sending back the response by DataManager. They are explained in the below documentation link which you can check for more details,
For example, If you are using the UrlAdaptor, you need to return the data as JSON from the controller action and the JSON object must contain a property as result with dataSource as its value and one more property count with the dataSource total records count as its value.
|
{
result: [{..}, {..}, {..}, ...], //JSON data source
count: Total data count
} |
|
{
Items: [{..}, {..}, {..}, ...],
Count: 830
} |
If you binding the data from external service, we suggest you to use the Ajax Binding feature using you can fetch the datasource from the server with the help of ajax request and provided that to DataSource property by using onSuccess event of the ajax as demonstrated in the below code example.
Code Example:
|
<script type="text/javascript">
var grid = document.getElementById('Grid').ej2_instances[0]; // Grid instance
var ajax = new ej.base.Ajax('/URL/, 'GET');
ajax.send();
ajax.onSuccess = function (data) {
grid.dataSource = JSON.parse(data);
};
</script> |
More details on this can be checked in the below documentation link,
Please get back to us if you need further assistance.
Regards,
Praveenkumar G