Skip to main content

GUI_DocumentSearch

This callback event is triggered when RxCore.documentTextSearch is used.

###Callback Parameters

  • searchMatches: An object that contains an array of objects that represnts the search result.

Example:

RxCore.GUI_DocumentSearch.connect(onGetMatches);

function onGetMatches(searchMatches) {


this.searchNumMatches = 0;
let id = 0;
this.pageIndex = []
searchMatches.forEach((match: any) => {
this.searchNumMatches += match.list.length;
match.list.forEach(item => {
item.match.id = id
id ++;
this.pageIndex.push(match.pgindex)
})
})

RxCore.markupSearchResult(); //highlights the text that matches the search

console.log(searchMatches)


}
}