Skip to main content
All docs
V24.1

SearchSettingsBuilder.FilterInterval(String) Method

Specifies the function that filters search results.

Namespace: DevExpress.AspNetCore.RichEdit

Assembly: DevExpress.AspNetCore.RichEdit.v24.1.dll

NuGet Package: DevExpress.AspNetCore.RichEdit

Declaration

public SearchSettingsBuilder FilterInterval(
    string filterInterval
)

Parameters

Name Type Description
filterInterval String

The name of the JavaScript function or the JavaScript function code that filters search results.

Returns

Type Description
SearchSettingsBuilder

An object that can be used to further configure search settings.

Remarks

The search panel and the Find and Replace dialog allow users to locate and modify text in the Rich Text Editor’s documents. Specify the filterInterval function to filter search results and prevent users from modifying certain document intervals.

The Rich Text Editor executes the filterInterval function for each search result. This function should accept the sub-document and text interval that contain the current search result and return a Boolean value. The control displays the search result if the filterInterval function returns true; otherwise, the control hides this result.

The example below demonstrates how to exclude intervals that contain fields from search results:

<script>
   function displaySearchResult(subDocument, interval) {
       return subDocument.fields.find(interval).length == 0;
   }
</script>
@(Html.DevExpress().RichEdit("RichEdit")
   .Search(searchSettings => {
       searchSettings.FilterInterval("displaySearchResult");
   })
   // ...
)
See Also