API Methods

ZingGrid provides a rich API for controlling grid interactions – from re-rendering to adjusting user interactions (like paging) through JavaScript. As an object, ZingGrid comes with its own set of methods that get/set properties and manipulate its contents.

Method Usage

The below example changes the current grid page with nextPage(). After selecting the ZingGrid instance, we wait until it is ready (executeOnLoad()) and then run the method to update the page.

CloseCopy Copied
const zgRef = document.querySelector('zing-grid');
zgRef.executeOnLoad(function() {
  zgRef.nextPage();
});

executeOnLoad() will ensure the grid is fully ready before executing your code. In most cases, if you execute your code below the grid instance in the DOM this can be omitted.

loadingloadBgloadBgloadBgloadBgloadBgloadBgloadBgloadBgloadBgloadBgloadBgloadBgloadBgloadBgloadingloadingloadingloadingloadingloadingloadingloadingloadingloadingloadingloadingloadingloadingloadingloadingloadingloadingloadingloadingloadingloading