API Element Usage

ZingGrid defines a set of Custom Elements (tags) that you can use to construct a data table or interactive grid. As a set of custom elements, ZingGrid tags natively use standard CSS properties and attributes, react to JavaScript events, and act as you would expect normal HTML tags to behave.


ZingGrid tags are an extension of native HTML and are used like any other tag:

CloseCopy Copied
<zing-grid data='[{"firstName":"John", "lastName":"Doe"}, {"firstName":"Jane", "lastName":"Doe"}]'>
  <zg-caption>Hello ZingGrid</zg-caption>

Since they are HTML tags, they support common attributes like id, class, title, etc.

CloseCopy Copied
<zing-grid id="my-grid" class="my-style"></zing-grid>

View the list of ZingGrid tags and the full list of HTML attributes


As extensions of native HTML elements, ZingGrid tags accept data attributes. Custom, predefined attributes are used to control the behavior of the grid, from quickly adding a styled caption-label to enabling search, sorting, and pagination.

CloseCopy Copied
  data='[{"firstName":"John", "lastName":"Doe"}, {"firstName":"Jane", "lastName":"Doe"}]'
  caption="Hello ZingGrid"

When the grid is rendered, the feature attributes are evaluated and the matching DOM markup is constructed and added automatically.

Note: Some elements are auto-generated during the render process. They are listed on the API Elements page but not intended for manual use. If the element has no public attributes listed, this is a good indicator that it is added automatically for you.