ResultsLinkView

The Results Link view

Description

The ResultsLink view displays a panel with buttons to open the search, export results, open the search job inspector, and refresh the page. This panel is the same as one that is included with the wrapper for converted visualizations, allowing you to use these controls with a search directly.

Library path

Properties

Name

Default value

Description

id Required. The unique ID for this control.
link.exportResults.visibleIndicates whether to show the Export button in the panel.
link.inspectSearch.visibleIndicates whether to show the Inspect button in the panel.
link.openSearch.searchThe alternative search query to use for the Open in Search button.
link.openSearch.searchEarliestTimeThe earliest time to use for the alternative search specified by link.openSearch.search.
link.openSearch.searchLatestTimeThe latest time to use for the alternative search specified by link.openSearch.search.
link.openSearch.text"Open in Search"The label to use for the Open in Search button.
link.openSearch.ViewTarget"Search"The name of the target view for the Open in Search button.
link.openSearch.visibleIndicates whether to show the Open in Search button in the panel.
link.visibletrueIndicates whether to show link buttons in the panel.
manageridnullThe ID of the search manager to bind this view to.

Example

require([
    "jquery",
    "splunkjs/mvc/searchmanager",
    "splunkjs/mvc/resultslinkview",
    "splunkjs/mvc/simplexml/ready!"
    ], function(
        $,
        SearchManager,
        ResultsLinkView
    ) {
        
    // Instantiate the search manager
    var mysearch = new SearchManager({
        id: "mysearch",
        search: "index=_internal | head 1000 | top 3 sourcetype"
    });

    // Instantiate the results link view
    var resultsLink = new ResultsLinkView({
        id: "resultsLink",
        managerid: "mysearch",
        "link.exportResults.visible": false,
        el: $("#controlpanel")
    });

    // Display the results link view
    resultsLink.render().$el.appendTo($("controlpanel"));
});