server
To load and import data from a remote URL. Server storage uses fetch
API to send the call and fetch the data.
optional
(data
,from
orserver
must be provided)- Example: Server, Server-side search and Server-side pagination
Name | Description | Type | Example |
---|---|---|---|
url | Server base URL | string | http://myapi.com |
method optional | HTTP method | string | GET , POST , etc |
headers optional | HTTP headers | HeadersInit | { 'Accept-Charset': 'utf-8', 'X-My-Custom-Header': 'cool' } |
body optional | HTTP Body payload | BodyInit | { 'loginId': 'gridjs', 'password': 'd4da' } |
then optional | Function to refine/select attributes | Function | (data) => [data.name, data.email] |
handle optional | Function to handle the response | Function | (res) => res.json() |
total optional | Function to set the total records | Function | (data) => data.total |