Documentation
jqxGrid sorts, filters and pages on its own once you turn those features on. This tutorial goes a step further: the page reads the grid's state after each change to show a summary line, and controls the grid from its own search box and buttons.
It also shows how grid events reach your code: through the on method of the grid's element, with the details in event.args.

Set up a page as in Bind the jQuery Grid to data, which also explains the data adapter. Sorting, filtering and paging need more files than a plain grid:
<script src="https://cdn.jsdelivr.net/npm/jqwidgets-scripts@27/jqwidgets/jqxcore.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jqwidgets-scripts@27/jqwidgets/jqxdata.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jqwidgets-scripts@27/jqwidgets/jqxbuttons.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jqwidgets-scripts@27/jqwidgets/jqxscrollbar.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jqwidgets-scripts@27/jqwidgets/jqxmenu.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jqwidgets-scripts@27/jqwidgets/jqxcheckbox.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jqwidgets-scripts@27/jqwidgets/jqxlistbox.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jqwidgets-scripts@27/jqwidgets/jqxdropdownlist.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jqwidgets-scripts@27/jqwidgets/jqxcalendar.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jqwidgets-scripts@27/jqwidgets/jqxdatetimeinput.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jqwidgets-scripts@27/jqwidgets/jqxgrid.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jqwidgets-scripts@27/jqwidgets/jqxgrid.selection.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jqwidgets-scripts@27/jqwidgets/jqxgrid.sort.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jqwidgets-scripts@27/jqwidgets/jqxgrid.filter.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jqwidgets-scripts@27/jqwidgets/jqxgrid.pager.js"></script>
jqxgrid.sort.js, jqxgrid.filter.js and jqxgrid.pager.js add the three features. jqxmenu.js draws the column menu; jqxlistbox.js, jqxdropdownlist.js and jqxcheckbox.js draw the pager's page-size list and the checked-list filter; jqxcalendar.js and jqxdatetimeinput.js the date range filter.
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.
grid.jqxGrid({
theme: 'fluent',
width: '100%',
autoheight: true,
source,
sortable: true,
filterable: true,
showfilterrow: true,
pageable: true,
pagesize: 10,
pagesizeoptions: ['10', '25', '50'],
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' }
]
});
A text filter applies when the user stops typing for a moment, or at once on Enter; the checked list applies when its drop-down closes.
The grid raises sort, filter, pagechanged and pagesizechanged after each change, and bindingcomplete when it has bound its data. Attach handlers with the on method of the grid's element; one call can take several event names, separated by spaces. The page answers all of them with the same function, which asks the grid for its current state and writes a summary:
// What the grid shows now: read from the grid after it binds, sorts, filters or pages.
function describe() {
const paging = grid.jqxGrid('getpaginginformation');
const sort = grid.jqxGrid('getsortinformation');
const rows = grid.jqxGrid('getdatainformation').rowscount;
const sorted = sort.sortcolumn ? `sorted by ${sort.sortcolumn} ${sort.sortdirection.ascending ? 'ascending' : 'descending'}` : 'not sorted';
status.textContent = `${rows} orders, page ${Number(paging.pagenum) + 1} of ${paging.pagescount}, ${sorted}`;
}
// Handlers attached before the grid is created also catch its first binding.
grid.on('bindingcomplete sort filter pagechanged pagesizechanged', describe);
Three details matter here:
bindingcomplete handler attached afterwards would miss it.$('#grid').on(…) receives them and addEventListener on the same element does not. The event's details are in event.args.sortby and gotopage. Setting an option from code, for example $('#grid').jqxGrid({ pagesize: 25 }), raises no event; call describe() yourself after it.Any grid method can be called from the page's own controls. A search box becomes a filter on the Customer column: removefilter drops the previous one (its false argument skips a redraw), addfilter adds a filter group, and applyfilters runs them.
// A customer search box of the page's own, applied as a grid filter on one column.
search.addEventListener('input', () => {
const text = search.value.trim();
grid.jqxGrid('removefilter', 'customer', false);
if (text) {
const group = new $.jqx.filter();
group.addfilter(0, group.createfilter('stringfilter', text, 'contains'));
grid.jqxGrid('addfilter', 'customer', group);
}
grid.jqxGrid('applyfilters');
});
Sorting and paging work the same way: sortby('quantity', 'desc'), gotopage(0), and to undo everything clearfilters() and removesort().
document.getElementById('largest').addEventListener('click', () => {
grid.jqxGrid('sortby', 'quantity', 'desc');
grid.jqxGrid('gotopage', 0);
});
document.getElementById('reset').addEventListener('click', () => {
search.value = '';
grid.jqxGrid('clearfilters');
grid.jqxGrid('removesort');
grid.jqxGrid('gotopage', 0);
});
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Orders</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/jqwidgets-scripts@27/jqwidgets/styles/jqx.base.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/jqwidgets-scripts@27/jqwidgets/styles/jqx.fluent.css">
<script src="https://cdn.jsdelivr.net/npm/jqwidgets-scripts@27/jqwidgets/jqxcore.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jqwidgets-scripts@27/jqwidgets/jqxdata.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jqwidgets-scripts@27/jqwidgets/jqxbuttons.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jqwidgets-scripts@27/jqwidgets/jqxscrollbar.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jqwidgets-scripts@27/jqwidgets/jqxmenu.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jqwidgets-scripts@27/jqwidgets/jqxcheckbox.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jqwidgets-scripts@27/jqwidgets/jqxlistbox.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jqwidgets-scripts@27/jqwidgets/jqxdropdownlist.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jqwidgets-scripts@27/jqwidgets/jqxcalendar.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jqwidgets-scripts@27/jqwidgets/jqxdatetimeinput.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jqwidgets-scripts@27/jqwidgets/jqxgrid.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jqwidgets-scripts@27/jqwidgets/jqxgrid.selection.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jqwidgets-scripts@27/jqwidgets/jqxgrid.sort.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jqwidgets-scripts@27/jqwidgets/jqxgrid.filter.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jqwidgets-scripts@27/jqwidgets/jqxgrid.pager.js"></script>
</head>
<body>
<main style="padding: 16px;">
<h1>Orders</h1>
<p>
<label>Customer contains <input id="search" type="search"></label>
<button id="largest" type="button">Largest orders first</button>
<button id="reset" type="button">Reset</button>
</p>
<p id="status" aria-live="polite"></p>
<div id="grid"></div>
</main>
<script type="module">
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) {
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 grid = $('#grid');
const status = document.getElementById('status');
const search = document.getElementById('search');
// What the grid shows now: read from the grid after it binds, sorts, filters or pages.
function describe() {
const paging = grid.jqxGrid('getpaginginformation');
const sort = grid.jqxGrid('getsortinformation');
const rows = grid.jqxGrid('getdatainformation').rowscount;
const sorted = sort.sortcolumn ? `sorted by ${sort.sortcolumn} ${sort.sortdirection.ascending ? 'ascending' : 'descending'}` : 'not sorted';
status.textContent = `${rows} orders, page ${Number(paging.pagenum) + 1} of ${paging.pagescount}, ${sorted}`;
}
// Handlers attached before the grid is created also catch its first binding.
grid.on('bindingcomplete sort filter pagechanged pagesizechanged', describe);
grid.jqxGrid({
theme: 'fluent',
width: '100%',
autoheight: true,
source,
sortable: true,
filterable: true,
showfilterrow: true,
pageable: true,
pagesize: 10,
pagesizeoptions: ['10', '25', '50'],
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' }
]
});
// A customer search box of the page's own, applied as a grid filter on one column.
search.addEventListener('input', () => {
const text = search.value.trim();
grid.jqxGrid('removefilter', 'customer', false);
if (text) {
const group = new $.jqx.filter();
group.addfilter(0, group.createfilter('stringfilter', text, 'contains'));
grid.jqxGrid('addfilter', 'customer', group);
}
grid.jqxGrid('applyfilters');
});
document.getElementById('largest').addEventListener('click', () => {
grid.jqxGrid('sortby', 'quantity', 'desc');
grid.jqxGrid('gotopage', 0);
});
document.getElementById('reset').addEventListener('click', () => {
search.value = '';
grid.jqxGrid('clearfilters');
grid.jqxGrid('removesort');
grid.jqxGrid('gotopage', 0);
});
</script>
</body>
</html>
The summary starts as 500 orders, page 1 of 50, not sorted. Type ernst in the search box: the grid shows the 62 orders of Ernst Handel on 7 pages. Largest orders first sorts them by quantity, Reset clears the search, the filters and the sort. The filter row works on its own too: in the Product list, clear (Select All) and check Chai to see its 63 orders.