Documentation

AutoComplete extends Component
in package

Table of Contents

$allItems  : mixed
$allowNew  : mixed
$autoKey  : mixed
$context  : mixed
$isActive  : mixed
$label  : mixed
$placeholder  : mixed
$query  : mixed
$value  : mixed
$listeners  : mixed
add()  : void
Add new item
clear()  : void
Clear query
filterItems()  : void
Filter items considering the query
mount()  : void
Mount the component
onReset()  : void
Reset item
onSelect()  : void
Set item query
onSelected()  : void
Select item
onUpdateItems()  : void
Reset items
render()  : void
Render function
setDefaultValue()  : void
Set default value, if supplied
setValue()  : void
Set value of component
updatedQuery()  : void
Make dropdown active once query is updated.

Properties

$listeners

protected mixed $listeners = ['AutoCompleteSelected' => 'onSelected', 'AutoCompleteReset' => 'onReset', 'AutoCompleteSelect' => 'onSelect', 'AutoCompleteUpdateItems' => 'onUpdateItems']

Methods

add()

Add new item

public add() : void
Return values
void

clear()

Clear query

public clear() : void
Return values
void

filterItems()

Filter items considering the query

public filterItems() : void
Return values
void

mount()

Mount the component

public mount(string $autoKey, Collection $items[, string $label = null ][, string $placeholder = null ][, mixed $value = null ][, bool $allowNew = false ]) : void
Parameters
$autoKey : string
  • Unique key by which this component will be identified
$items : Collection
  • Items collection
$label : string = null
  • Label to be used
$placeholder : string = null
  • Placeholder to be used
$value : mixed = null
  • Default value for the component
$allowNew : bool = false
  • New value is allowed
Return values
void

onReset()

Reset item

public onReset(string $autoKey) : void
Parameters
$autoKey : string
Return values
void

onSelect()

Set item query

public onSelect(string $autoKey, mixed $value) : void
Parameters
$autoKey : string
$value : mixed
Return values
void

onSelected()

Select item

public onSelected(string $context, string $value, string $label) : void
Parameters
$context : string
$value : string
$label : string
Return values
void

onUpdateItems()

Reset items

public onUpdateItems(string $autoKey, Collection $items) : void
Parameters
$autoKey : string
$items : Collection
Return values
void

render()

Render function

public render() : void
Return values
void

setDefaultValue()

Set default value, if supplied

public setDefaultValue() : void
Return values
void

setValue()

Set value of component

public setValue(string $value) : void
Parameters
$value : string
Return values
void

updatedQuery()

Make dropdown active once query is updated.

public updatedQuery(string $value) : void
Parameters
$value : string
Return values
void

Search results