ListSchedSearches - AFS

AFS Integration Guide

Product
AFS
AFS_Version
7.7
Category
Reference Guide

This widget allows to list the saved searches of the logged in user. When the scheduled searches list is displayed, the user can restore a saved search context, or remove one of those searches.

This widget requires authentication (Login widget).

Example:

<div class="AFSWidget" title="ListSchedSearches">
<script type="application/json">
{
"mainButtonActiveLabel": "Scheduled searches",
"mainButtonInactiveLabel": "Scheduled searches",
"noSchedSearchLabel": "(empty)"
}
</script>
</div>

ListSchedSearches - This widget allows to list the saved searches of the logged user.

Parameter

Type

Card

Default

Description

target

String

Optional

""

Property to use to indicate a page where a search should open.

itemsViewCustomActionsCallback

String/Function

Optional

N/A

Name of an existing function or function that can be called to build additional actions to display at the bottom of the items list view.

itemViewCustomActionsCallback

String/Function

Optional

N/A

Name of an existing function or function that can be called to build additional actions to display at the bottom of the item details view.

outsideClickTogglePanel

Boolean

Optional

false

Indicates if the click has to be monitored to change the widget state. See tip below.

At integration time, the widget can be styled as a pop-up. The click on the main button toggles the presence of a CSS class on the widget top-level container, allowing to update the panel visibility. If styled as a pop-up, the outsideClickTogglePanel option can be useful to change the widget state when a click occurs outside of the widget panel, by removing the previously mentioned CSS class.

A JavaScript-based configuration could look like this:

var AFSWidgetListSchedSearches = {
itemViewCustomActionsCallback: function(element, search){
element.innerHTML = '<button onclick="alert(\''+search.name+'\');">Custon button on a search</button>';
},
itemsViewCustomActionsCallback: function(element, book){
element.innerHTML = '<button onclick="alert(\''+book.name+'\');">Custom button on the searches list</button>';
},
outsideClickTogglePanel: true,
target: '/search-page'
};