Search across the sheets of a workbook
Find a value in a workbook that is mostly not rendered.
Virtualisation means most of a large workbook is not in the DOM at any moment, which is exactly why searching the DOM does not work. The index comes from the parsed model, so a hit in row 40,000 of the fourth sheet is found immediately and painted when you scroll to it.
const search = await viewer.search();
const hits = search.find('invoice');
// Every hit is painted, including on pages that are not mounted:
// the index is built from the model, not from the DOM.
search.highlight(hits);