features
Menu
Menu

Server Features

ZingGrid has built-in params to connect and query server REST endpoints.

On This Page

Connecting

Use the <zg-param> tag to enable connection to a server endpoint.

The API only returns ten results at a time, so you must implement server paging to properly connect to this endpoint.

CloseCopy Copied
<!-- define the main source for the API -->
<zg-param name="src" value="https://swapi.co/api/people/"></zg-param>
<!--
  define the path in the JSON to get the array of results.
  In this case it is body.results
-->
<zg-param name="recordPath" value="results"></zg-param>
Edit
Download
CloseCopy Copied
CloseCopy Copied
CloseCopy Copied

Paging

Enable server paging through a couple <zg-param> attributes.
CloseCopy Copied
<zg-param name="loadByPage" value="true"></zg-param>
<!-- define the "page" query parameter -->
<zg-param name="pageKey" value="page"></zg-param>
<!--
  Need to tell ZG how many records were returned so it knows
  how to divide up the page-size
-->
<zg-param name="countPath" value="count"></zg-param>
<!-- define the path in the result JSON to find next/prev urls -->
<zg-param name="nextPath" value="next"></zg-param>
<zg-param name="prevPath" value="previous"></zg-param>
Edit
Download
CloseCopy Copied
CloseCopy Copied
CloseCopy Copied

Search

Use the searchKey attribute to enable server search.
CloseCopy Copied
<zg-param name="searchKey" value="search"></zg-param>
Edit
Download
CloseCopy Copied
CloseCopy Copied
CloseCopy Copied

Join the Community

Support, extra demos, pre-releases and more

loadingloadBgloadBgloadBgloadBgloadBgloadBgloadBgloadBgloadBgloadBgloadBgloadBgloadBgloadBgloading