SaveSearchToolbar

App.searchV2. SaveSearchToolbar

This module adds default toolbar with in-built commands.

Constructor

new SaveSearchToolbar(input)

See:

To create an instance, use factory method App.searchV2.createSaveSearchToolbar

Parameters:
Name Type Description
input object

input

Methods

addSearch(search, doSearchCallback)

Adds new search to toolbar saved searches.

Parameters:
Name Type Description
search Object

Search object to be added.

doSearchCallback function

callback function to execute search when search icon on saved search is clicked.

closeSaveSearch()

Closes the saved search drop

deleteSearch(searchId)

Emits event to delete search when search is deleted by user

Parameters:
Name Type Description
searchId string

id search to be deleted.

destroy()

Performs clean up of references

doSearch(searchId)

Emits event to load and perform search

Parameters:
Name Type Description
searchId string

id search to be loaded.

emit(event, dataopt)

Parameters:
Name Type Attributes Default Description
event Object

Event to be emitted

data Object <optional>
{}

data emitted with event

getApi() → {Object}

Returns API methods for this class

Returns:
  • object of api functions
Type
Object

getLoadSearchDropHtml(item, drop) → {string}

Returns load search drop content Html.

Parameters:
Name Type Description
item Object

reference to toolbar item

drop Object

reference to drop element

Returns:
  • load search drop content
Type
string

getSaveSearchDropHtml(item, drop) → {string}

Returns save search drop content Html.

Parameters:
Name Type Description
item Object

UIP Toolbar item def

drop Object

UIP Toolbar item drop element

Returns:
  • save search drop content
Type
string

getToolbarItems() → {Object}

Returns toolbar json object.

Returns:

toolbar object

Type
Object

loadSearch(searchId)

Emits event to load search when search is selected to be loaded by user.

Parameters:
Name Type Description
searchId string

id search to be loaded.

off(event, handler)

Parameters:
Name Type Description
event Object

Event to be removed

handler function

Event handler

on(event, handler)

Parameters:
Name Type Description
event Object

Event to be registered

handler function

Event handler

removeSearch(id)

Removes search from toolbar

Parameters:
Name Type Description
id string

id of search to be deleted.

saveSearch(name)

Emits event to save search when new search is added by user.

Parameters:
Name Type Description
name string

name search to be added.