Skip to content

Find across server rows

Open Find and search for notebook. Press Enter twice to move from Notebook on page one to Notebook stand on page two. The sample datasource runs in the browser.

Install GridFindPlugin alongside a remotely configured PaginationPlugin. The adapter receives the match index, visible column properties, active pagination filters and sort, and a cancellation signal. Return the total number of matching cells and the match at that index. Find starts by requesting index zero and fetches later matches as the reader browses. Set up remote pagination.

grid.plugins = [PaginationPlugin, GridFindPlugin];
grid.gridFind = {
remote: {
getRowId: (row) => row.id,
async search({ signal, ...request }) {
const response = await fetch('/api/orders/find', {
method: 'POST',
headers: { 'content-type': 'application/json' },
body: JSON.stringify(request),
signal,
});
if (!response.ok) throw new Error('Find failed');
return response.json();
},
},
};

A match has the shape { rowId, rowOffset, prop }. Use the row’s zero-based position in the complete filtered and sorted result for rowOffset. Use a unique, stable string or numeric ID for rowId. Return { total: 0 } when there are no matches. If a request no longer has a match at its index, return the updated total without a match.

Apply the same query to search and page requests. Both receive the legacy sort map and an explicit priority list, query.sortOrder for Find and context.sortOrder in the pagination loader. Use the latter to preserve priority for numeric properties. The query also includes the current quick filter and canonical filter tree when set. Applications authorize both requests.

Navigation loads the required page and checks the stable row ID and visible column before focusing the cell. If a location is stale, rerun the search. New queries supersede old ones, and closing Find cancels pending search requests. This mode uses remote pagination and supports navigation only. For loaded-row replacement, use the local Find and Replace guide.

Committed grid edits and acknowledged remote pagination batches refresh an active search. For writes that your application commits separately, call searchRemote() with the current search text after the server acknowledges the write.

If an external button opens Find, pass the button to open(button). Escape returns focus to that button.

If you provide your own toolbar, call searchRemote(term), read getRemoteState() for the total and status, and call navigate(1) or navigate(-1).