Grid for Vue
Vue 3 version using Smart custom elements and template refs.
What this topic covers: Focuses on page size, navigation behavior, and state expectations so users can browse large datasets with consistent performance.
<script setup>
import { onMounted, ref } from 'vue';
import 'smart-webcomponents/source/styles/smart.default.css';
import 'smart-webcomponents/source/modules/smart.grid.js';
const component = ref();
const componentProps = {
// Copy this topic's JavaScript configuration here.
};
onMounted(() => {
Object.assign(component.value, componentProps);
});
</script>
<template>
<smart-grid ref="component"></smart-grid>
</template>
Use component.value for API methods in this topic.
Build your web apps using Smart UI
Smart.Grid - Paging
Grid Paging
Pagination can be enabled in Smart.Grid in order to view large data sets page by page and navigate through them easily.
Pagination is configured via two properties/objects: paging and pager.
To enable paging, set paging.enabled to true.
The number of Grid rows per page can be set via paging.pageSize. The default number is 10. The current page index can be get or set by accessing paging.pageIndex.
Once pages are set up, they can be navigated in two ways:
More information: property paging in the Grid API documentation.
Pager
Pager is a user interface component that allows for easy navigation of Grid pages and customization of paging settings. The pager part of Smart.Grid is an instance of Smart.Pager (<smart-pager>)
To enable the pager, set pager.visible to true.
Parts of the pager:
- Navigation buttons
- Page index selectors
- Auto ellipsis
- Navigation input
- Page size selector
- Summary
Additional settings of the pager object that control these parts are:
- autoEllipsis - sets the ellipsis display mode.
- position - sets the position of pager - 'near' (above rows), 'far' (below rows), or 'both'.
- template - sets a template for the pager.
- pageSizeSelector - describes the settings for the 'rows per page' option.
- summary - describes the summary settings.
- navigationButtons - describes the navigation buttons settings.
- navigationInput - describes the settings about navigation input option.
- pageIndexSelectors - describes the settings for the numeric page buttons.
More information: property pager in the Grid API documentation.
Spinner
An alternative to the pager is the spinner, which can be enabled by setting paging.spinner.enabled to true. The spinner appears as a pair of arrows above the Grid's scrollbar. Pressing the arrows navigates through Grid pages.
The property paging.spinner.step determines the number of pages to navigate via the spinner.
For AI tooling
Developer Quick Reference
Topic: grid-paging Component: Grid Framework: Vue
Main methods: (none detected)
Common config keys: pager
Implementation Notes
Compatibility: Vue 3+ API access pattern: const component = ref() + component.value.method()
Lifecycle guidance: Use template refs with