This sample demonstrates how to bind a data from various remote services to the Grid component.
Service
|
|
Adaptor
|
|
|
|
Additional Parameters
|
|
|
|
|
|
HTTP Headers
|
|
|
|
|
|
|
The Grid supports data binding. The dataSource
property can be assigned with the instance of DataManager
to bind remote data.
The DataManager, which will act as an interface between the service endpoint and the Grid, will require the below minimal information to interact with service endpoint properly.
DataManager->url
- Defines the service endpoint to fetch dataDataManager->adaptor
- Defines the adaptor option.
Adaptor is responsible for
processing response and request from/to the service endpoint.
syncfusion/ej2-data
package provides some predefined adaptors which are designed to interact with
particular service endpoints. They are,
UrlAdaptor
- Use this to interact any remote services. This is the base adaptor for all remote
based
adaptors.
ODataAdaptor
- Use this to interact with OData endpoints.ODataV4Adaptor
- Use this to interact with OData V4 endpoints.WebApiAdaptor
- Use this to interact with Web API created under OData standards.dataStateChange
event of grid.
By default ODataAdaptor is used in this demo. The adaptor type will be automatically assigned based on the selected data service.
The dataSource of grid can be dynamically changed using changeDataSource
method by following the below
steps
More information on the data binding can be found in this documentation section.