Vue UI Components Documentation
jqxGrid sorts, filters and pages on its own once you turn those features on. This tutorial goes a step further: the component reads the grid's state to show a summary line, and controls the grid from its own search box and buttons.
It also explains the rule that keeps a grid working inside a Vue component: give JqxGrid props that never change.

Use a Vite and Vue 3 app set up as in Add a Grid to a Vue 3 app. Bind the Vue Grid to data explains the data adapter used here.
sortable lets users sort by clicking a column header. filterable with showfilterrow adds a row of filter inputs under the headers, and each column's filtertype picks the input: text by default, checkedlist for a list of values, number for numbers, range for a date range. pageable adds a pager, and pagesizeoptions lists the page sizes a user can pick.
const columns = [
{ text: 'Customer', datafield: 'customer', width: 200 },
{ text: 'Product', datafield: 'product', width: 140, filtertype: 'checkedlist' },
{ text: 'Quantity', datafield: 'quantity', width: 100, cellsalign: 'right', align: 'right', filtertype: 'number' },
{ text: 'Price', datafield: 'price', width: 100, cellsalign: 'right', align: 'right', cellsformat: 'c2', filtertype: 'number' },
{ text: 'Date', datafield: 'date', cellsformat: 'yyyy-MM-dd', filtertype: 'range' }
];
Each time the Grid component re-renders, it applies its props to the grid again: in jqwidgets-scripts 27.1.0 the props whose value changed, in earlier versions all of them, source included. A new source makes the grid bind its data again and drop its sort, filters and page, and in 27.1.0 an array made during the render, such as :pagesizeoptions="sizes.slice()", still sends it back to its first page.
Vue re-renders a child component only when one of its props has a new value. So make every prop of JqxGrid a constant: the adapter, the columns and the page sizes are plain constants of the script, and the event handlers are functions declared in it. A new status line, or a key typed in the search box, then re-renders this component but not the grid, which keeps its sort, filters and page.
<template>
<main style="padding: 16px">
<h1>Orders</h1>
<p style="display: flex; flex-wrap: wrap; gap: 8px; align-items: center">
<label>Customer contains <input v-model="search" /></label>
<button type="button" @click="showLargestOrders">Largest orders first</button>
<button type="button" @click="reset">Reset</button>
</p>
<p aria-live="polite">{{ status }}</p>
<!-- Every prop is a constant, so a new status or search text re-renders this component
but not the grid, which keeps its sort, filters and page. -->
<JqxGrid
ref="grid"
width="100%"
:autoheight="true"
theme="material-purple"
:source="source"
:columns="columns"
:sortable="true"
:filterable="true"
:showfilterrow="true"
:pageable="true"
:pagesize="10"
:pagesizeoptions="pagesizeoptions"
@sort="describe"
@filter="describe"
@pagechanged="describe"
@pagesizechanged="describe"
/>
</main>
</template>
Vue's compiler treats an inline literal such as :pagesizeoptions="['10', '25', '50']" as a constant, and caches an inline handler such as @sort="() => describe()", so those are safe too. What re-renders the grid is a prop whose value changes: a ref or computed passed to it, or an expression that builds a new object each time, such as :columns="makeColumns()".
The grid raises sort, filter, pagechanged and pagesizechanged; the component listens with @sort, @filter and so on. All four call the same function, which asks the grid for its current state through the template ref and stores a summary in a ref:
// What the grid shows now: read from the grid after it sorts, filters or pages.
function describe() {
const g = grid.value;
if (!g) {
return;
}
const paging = g.getpaginginformation();
const sort = g.getsortinformation();
const rows = g.getdatainformation().rowscount;
const sorted = sort.sortcolumn ? `sorted by ${sort.sortcolumn} ${sort.sortdirection.ascending ? 'ascending' : 'descending'}` : 'not sorted';
status.value = `${rows} orders, page ${Number(paging.pagenum) + 1} of ${paging.pagescount}, ${sorted}`;
}
// The grid binds its data while it is created, before the component's onMounted runs:
// describe it once then.
onMounted(describe);
A grid with local data binds while it is created, before the Grid component listens for its events, so a @bindingcomplete handler would not run. The component describes the grid once in onMounted instead: a child is mounted before its parent, so the grid exists by then.
Any grid method can be called through the template ref. A search box of the component's own, bound with v-model, becomes a filter on the Customer column through a watcher: removefilter drops the previous one without redrawing, addfilter adds a filter group, and applyfilters runs them.
// A customer search box of the app's own, applied as a grid filter on one column.
watch(search, (text) => {
const g = grid.value;
if (!g) {
return;
}
g.removefilter('customer', false);
if (text) {
const group = new jqx.filter();
group.addfilter(0, group.createfilter('stringfilter', text, 'contains'));
g.addfilter('customer', group);
}
g.applyfilters();
});
Sorting and paging work the same way: sortby('quantity', 'desc'), gotopage(0), and to undo everything clearfilters() and removesort().
function showLargestOrders() {
grid.value?.sortby('quantity', 'desc');
grid.value?.gotopage(0);
}
function reset() {
search.value = '';
grid.value?.clearfilters();
grid.value?.removesort();
grid.value?.gotopage(0);
}
<script setup lang="ts">
import { onMounted, ref, watch } from 'vue';
import JqxGrid from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxgrid.vue';
// Defined globally by the jQWidgets core, which the Grid component imports.
declare const jqx: any;
interface Order {
id: number;
customer: string;
product: string;
quantity: number;
price: number;
date: Date;
}
// The grid methods this component calls.
interface GridMethods {
getpaginginformation: () => { pagenum: number | string; pagesize: number | string; pagescount: number };
getsortinformation: () => { sortcolumn: string | null; sortdirection: { ascending: boolean; descending: boolean } };
getdatainformation: () => { rowscount: number | string };
removefilter: (datafield: string, refresh?: boolean) => void;
addfilter: (datafield: string, filtergroup: unknown, refresh?: boolean) => void;
applyfilters: () => void;
clearfilters: () => void;
sortby: (datafield: string, order: 'asc' | 'desc' | null) => void;
removesort: () => void;
gotopage: (pagenum: number) => void;
}
const customers = ['Alfreds Futterkiste', 'Bon app', 'Ernst Handel', 'Frankenversand', 'Königlich Essen', 'Que Delícia', 'Wartian Herkku', 'Wilman Kala'];
const products = ['Chai', 'Chang', 'Ikura', 'Konbu', 'Tofu', 'Pavlova', 'Gnocchi', 'Mascarpone'];
// 500 sample orders in 2026, the same on every load.
function makeOrders(count: number): Order[] {
const start = new Date(2026, 0, 1).getTime();
const day = 24 * 60 * 60 * 1000;
return Array.from({ length: count }, (_, i) => ({
id: i + 1,
customer: customers[(i * 7) % customers.length],
product: products[(i * 5) % products.length],
quantity: 1 + ((i * 13) % 20),
price: Math.round((2 + ((i * 37) % 45) + ((i * 11) % 100) / 100) * 100) / 100,
date: new Date(start + ((i * 3) % 270) * day)
}));
}
const source = new jqx.dataAdapter({
localdata: makeOrders(500),
datatype: 'array',
id: 'id',
datafields: [
{ name: 'customer', type: 'string' },
{ name: 'product', type: 'string' },
{ name: 'quantity', type: 'number' },
{ name: 'price', type: 'number' },
{ name: 'date', type: 'date' }
]
});
const columns = [
{ text: 'Customer', datafield: 'customer', width: 200 },
{ text: 'Product', datafield: 'product', width: 140, filtertype: 'checkedlist' },
{ text: 'Quantity', datafield: 'quantity', width: 100, cellsalign: 'right', align: 'right', filtertype: 'number' },
{ text: 'Price', datafield: 'price', width: 100, cellsalign: 'right', align: 'right', cellsformat: 'c2', filtertype: 'number' },
{ text: 'Date', datafield: 'date', cellsformat: 'yyyy-MM-dd', filtertype: 'range' }
];
const pagesizeoptions = ['10', '25', '50'];
const grid = ref<GridMethods | null>(null);
const status = ref('');
const search = ref('');
// What the grid shows now: read from the grid after it sorts, filters or pages.
function describe() {
const g = grid.value;
if (!g) {
return;
}
const paging = g.getpaginginformation();
const sort = g.getsortinformation();
const rows = g.getdatainformation().rowscount;
const sorted = sort.sortcolumn ? `sorted by ${sort.sortcolumn} ${sort.sortdirection.ascending ? 'ascending' : 'descending'}` : 'not sorted';
status.value = `${rows} orders, page ${Number(paging.pagenum) + 1} of ${paging.pagescount}, ${sorted}`;
}
// The grid binds its data while it is created, before the component's onMounted runs:
// describe it once then.
onMounted(describe);
// A customer search box of the app's own, applied as a grid filter on one column.
watch(search, (text) => {
const g = grid.value;
if (!g) {
return;
}
g.removefilter('customer', false);
if (text) {
const group = new jqx.filter();
group.addfilter(0, group.createfilter('stringfilter', text, 'contains'));
g.addfilter('customer', group);
}
g.applyfilters();
});
function showLargestOrders() {
grid.value?.sortby('quantity', 'desc');
grid.value?.gotopage(0);
}
function reset() {
search.value = '';
grid.value?.clearfilters();
grid.value?.removesort();
grid.value?.gotopage(0);
}
</script>
<template>
<main style="padding: 16px">
<h1>Orders</h1>
<p style="display: flex; flex-wrap: wrap; gap: 8px; align-items: center">
<label>Customer contains <input v-model="search" /></label>
<button type="button" @click="showLargestOrders">Largest orders first</button>
<button type="button" @click="reset">Reset</button>
</p>
<p aria-live="polite">{{ status }}</p>
<!-- Every prop is a constant, so a new status or search text re-renders this component
but not the grid, which keeps its sort, filters and page. -->
<JqxGrid
ref="grid"
width="100%"
:autoheight="true"
theme="material-purple"
:source="source"
:columns="columns"
:sortable="true"
:filterable="true"
:showfilterrow="true"
:pageable="true"
:pagesize="10"
:pagesizeoptions="pagesizeoptions"
@sort="describe"
@filter="describe"
@pagechanged="describe"
@pagesizechanged="describe"
/>
</main>
</template>
Type part of a customer's name, for example ernst: the grid shows 62 of the 500 orders and the summary line follows. Largest orders first sorts by quantity, and Reset clears the filters and the sort.