\TypeAheadField
Synopsis
class TypeAheadField
extends TextField
{
- // members
- private static array $allowed_actions = ;
- public $sourceClass;
- public string|array $sourceField = NULL;
- public string $refField = 'Title';
- public string $valField = 'Title';
- public SS_List|array|string|Closure $sourceList;
- public string|boolean $suggestURL;
- public integer $limit = 10;
- public integer $minSearchLength = 2;
- public boolean $requireSelection = false;
- public integer|String $prefetch = 10;
- public array $disabledOptions = ;
- public array $lockedOptions = ;
- public string|boolean $sortArray = false;
- public string $queryKey = 'q';
- public string $separator = '|';
- protected Callable $resultsCallback;
- protected array $disallowedSearchTypes = ;
- // methods
- public void __construct()
- public $this setSourceClass()
- public void setSourceField()
- public void setSourceList()
- public void setSource()
- public void getSourceList()
- public void getSourceClass()
- public void getSuggestURL()
- public void setSuggestURL()
- public void getPrefetchURL()
- public void setPrefetch()
- public void setMinimumSearchLength()
- public void requireSelection()
- public void setQueryKey()
- public void setResultsCallback()
- public void getAttributes()
- public void Field()
- public void suggestion()
- public void prefetch()
- public void results()
- public void filterArray()
- public void filterList()
- public void resultsToMap()
- public void resultToMap()
- public void resultGroupToMap()
- public void getValueFromItem()
- public void validate()
- protected void getListToUse()
- protected void scaffoldSearchFields()
- protected void includeJs()
- protected void includeCss()
Hierarchy
Extends
- TextField
Members
private
- $allowed_actions
protected
- $disallowedSearchTypes
- $resultsCallback — Callable
public
- $disabledOptions — array
- $limit
—
integer
Maximum number of search results to display per search - $lockedOptions — array
- $minSearchLength
—
integer
Minimum number of characters that a search will act on - $prefetch
—
integer|String
Prefetch a number of results so user has some to select from Will also accept a URL to override field prefetch - $queryKey — string
- $refField — string
- $requireSelection
—
boolean
Flag indicating whether a selection must be made from the existing list (creating a tag field) By default free text entry is not allowed. - $separator — string
- $sortArray — string|boolean
- $sourceClass — string
- $sourceField — string|array
- $sourceList
—
SS_List|array|string|Closure
List used to search in database (if not provided, uses source class and source field instead) Will also accept a URL to override field suggestion - $suggestURL — string|boolean
- $valField — string
Methods
protected
public
- __construct()
- Field()
- filterArray()
- filterList()
- getAttributes()
- getPrefetchURL()
- getSourceClass()
- getSourceList()
- getSuggestURL()
- getValueFromItem()
- prefetch()
- requireSelection()
- resultGroupToMap()
- resultToMap()
- results()
- resultsToMap()
- setMinimumSearchLength()
- setPrefetch()
- setQueryKey()
- setResultsCallback()
- setSource()
- setSourceClass() — Set source class
- setSourceField()
- setSourceList()
- setSuggestURL()
- suggestion()
- validate()