gradereport_grader/search/search_class

Description:
  • The class that manages the state of the search.

Source:
License:
  • http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

The class that manages the state of the search.

Members

moveToFirstNode

Description:
  • Set the focus on the first node within the array.

Source:

Set the focus on the first node within the array.

moveToLastNode

Description:
  • Set the focus to the final node within the array.

Source:

Set the focus to the final node within the array.

moveToNode

Description:
  • Set focus on any given specified node within the node array.

Source:

Set focus on any given specified node within the node array.

selectNode

Description:
  • Set focus on a given node after parsed through the calling functions.

Source:

Set focus on a given node after parsed through the calling functions.

Methods

(async) clickHandler(e)

Description:
  • The handler for when a user interacts with the component.

Source:
Parameters:
Name Type Description
e MouseEvent

The triggering event that we are working with.

closeSearch(clear)

Description:
  • When called, close the dropdown and reset the input field attributes.

Source:
Parameters:
Name Type Default Description
clear Boolean false

Conditionality clear the input box.

fetchDataset()

Description:
  • Stub out a required function.

Source:

filterDataset(dataset)

Description:
  • Stub out a required function.

Source:
Parameters:
Name Type Description
dataset Array

filterMatchDataset()

Description:
  • Stub out a required function.

Source:

(async) getDataset() → {Promise.<null>}

Description:
  • Return the dataset that we will be searching upon.

Source:
Returns:
Type
Promise.<null>

getDatasetSize() → {number}

Description:
  • Return the size of the dataset.

Source:
Returns:
Type
number

getHTMLElements() → {object}

Description:
  • Return an object containing a handfull of dom nodes that we sometimes need the value of.

Source:
Returns:
Type
object

getMatchedResults() → {Array}

Description:
  • Return the results of the filter upon the dataset.

Source:
Returns:
Type
Array

getPreppedSearchTerm() → {string}

Description:
  • Get the transformed search value.

Source:
Returns:
Type
string

getSearchTerm() → {string}

Description:
  • Get the value that the user entered.

Source:
Returns:
Type
string

keyHandler(e)

Description:
  • The handler for when a user presses a key within the component.

Source:
Parameters:
Name Type Description
e KeyboardEvent

The triggering event that we are working with.

keyUpDown(direction, e)

Description:
  • Set the current focus either on the preceding or next result item.

Source:
Parameters:
Name Type Description
direction Number

Is the user moving up or down the resultset?

e KeyboardEvent

The JS event from the event handler.

registerClickHandlers()

Description:
  • Register clickable event listeners.

Source:

registerInputHandlers()

Description:
  • Register input event listener for the text input area.

Source:

registerKeyHandlers()

Description:
  • Register key event listeners.

Source:

(async) renderAndShow() → {Promise.<void>}

Description:
  • A combo method to take the matching fields and render out the results.

Source:
Returns:
Type
Promise.<void>

renderDropdown()

Description:
  • Stub out a required function.

Source:

setComponentSelector()

Description:
  • Stub out a required function.

Source:

setDropdownSelector()

Description:
  • Stub out a required function.

Source:

setMatchedResults(result)

Description:
  • Given a filter has been run across the dataset, store the matched results.

Source:
Parameters:
Name Type Description
result Array

setSearchTerms(result)

Description:
  • When a user searches for something, set our variable to manage it.

Source:
Parameters:
Name Type Description
result string

setTriggerSelector()

Description:
  • Stub out a required function.

Source:

toggleDropdown(on)

Description:
  • When called, update the dropdown fields.

Source:
Parameters:
Name Type Default Description
on Boolean false

Flag to toggle hiding or showing values.

updateNodes()

Description:
  • These class members change when a new result set is rendered. So update for fresh data.

Source: