Back to Devexpress

SearchAvailable Function

xtrareports-js-devexpress-dot-reporting-dot-viewer-dot-settings-dot-searchavailable-1.md

latest2.0 KB
Original Source

SearchAvailable Function

Enables the Search action.

Declaration

ts
export const SearchAvailable: DevExpress.Analytics.Internal.IGlobalSubscribableValue<boolean>

Parameters

NameType
newValboolean

Returns

TypeDescription
boolean

True to enable the Search action; otherwise, false.

|

Remarks

Set the SearchAvailable property to false to disable the action that displays the Search panel.

You can handle the ASPxClientWebDocumentViewer.CustomizeElements event and specify the SearchAvailable setting to remove the Search action in the Document Viewer:

aspx
<dx:ASPxWebDocumentViewer ID="ASPxWebDocumentViewer1" runat="server">
    <ClientSideEvents CustomizeElements = "function(s, e) {
        DevExpress.Reporting.Viewer.Settings.SearchAvailable(true);}" />
</dx:ASPxWebDocumentViewer>
cshtml
@Html.DevExpress().WebDocumentViewer(settings => {
    settings.Name = "WebDocumentViewer1";
    settings.ClientSideEvents.CustomizeElements = 
        "function(s, e){ DevExpress.Reporting.Viewer.Settings.SearchAvailable(true); }";
}).Bind("TestReport").GetHtml()
cshtml
<script type="text/javascript" id="script">
    function configureViewer(s, e) {
    DevExpress.Reporting.Viewer.Settings.SearchAvailable(true);
    }
</script>

@{
    var documentViewer = Html.DevExpress().WebDocumentViewer("webDocumentViewer1").Height("1000px");
    documentViewer.Bind("TestReport");
    documentViewer.ClientSideEvents(configure => { configure.CustomizeElements("configureViewer"); });
}
@documentViewer

SearchAvailable(true)

SearchAvailable(false)