Docs

Server Features

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

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.

<!-- 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>
Top

Paging

Enable server paging through a couple <zg-param> attributes.

<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>
Top

Search

Use the searchKey param to enable server search.

Use the searchKey param to enable server search.
Top