| Methods |
protected
|
init(): void
Called when view becomes part of render tree. You can override it but avoid
placing any "heavy processing" here.
Called when view becomes part of render tree. You can override it but avoid
placing any "heavy processing" here.
Overrides
|
#
|
protected
|
jsDropdown(bool|string $when = false, JsExpressionable $action = null): Jquery
|
#
|
protected
|
getCallbackUrl(): string
Returns URL which would respond with first 50 matching records.
Returns URL which would respond with first 50 matching records.
|
#
|
public
|
outputApiResponse(): never
Generate API response.
|
#
|
public
|
getData(int|bool $limit = true): array<int, array{value: mixed, title: mixed}>
Generate Lookup data.
|
#
|
public
|
renderRow(Model $row): array{value: mixed, title: mixed}
Renders the Lookup row depending on properties set.
Renders the Lookup row depending on properties set.
|
#
|
public
|
defaultRenderRow(Model $row, string $key = null): array{value: mixed, title: mixed}
Default callback for generating data row.
Default callback for generating data row.
|
#
|
protected
|
initQuickNewRecord(): void
Add button for new record.
Add button for new record.
|
#
|
protected
|
applyLimit(int|bool $limit = true): void
Apply limit to model.
|
#
|
protected
|
applySearchConditions(): void
Apply conditions to model based on search string.
Apply conditions to model based on search string.
|
#
|
protected
|
applyDependencyConditions(): void
Apply conditions to model based on dependency.
Apply conditions to model based on dependency.
|
#
|
protected
|
initDropdown(Jquery $chain): void
Override this method if you want to add more logic to the initialization of the auto-complete field.
Override this method if you want to add more logic to the initialization of the auto-complete field.
|
#
|
protected
|
renderView(): void
View-specific rendering stuff. Feel free to replace this method with
your own. View::renderView contains some logic…
View-specific rendering stuff. Feel free to replace this method with
your own. View::renderView contains some logic that integrates with
Fomantic-UI.
Overrides
|
#
|
| Properties |
public
|
|
$defaultTemplate = 'form/control/lookup.html'
|
#
|
public
|
string
|
$inputType = 'hidden'
|
#
|
public
|
array
|
$values = []
Declare this property so Lookup is consistent as decorator to replace Form\Control\Dropdown.
Declare this property so Lookup is consistent as decorator to replace Form\Control\Dropdown.
|
#
|
public
|
CallbackLater
|
$callback
Object used to capture requests from the browser.
Object used to capture requests from the browser.
|
#
|
public
|
string
|
$empty = "\u{00a0}"
Set this to true, to permit "empty" selection. If you set it to string, it will be used as a placeholder for empty…
Set this to true, to permit "empty" selection. If you set it to string, it will be used as a placeholder for empty value.
|
#
|
public
|
list<string>|(Closure(Model, string): void)|null
|
$search
|
#
|
public
|
(Closure(Model, array<string, mixed>): void)|null
|
$dependency
|
#
|
public
|
bool|string|array|null
|
$plus = false
|
#
|
public
|
int
|
$limit = 100
Sets the max. amount of records that are loaded.
Sets the max. amount of records that are loaded.
|
#
|
public
|
string|null
|
$idField
Set custom model field here to use it's value as ID in dropdown instead of default model ID field.
Set custom model field here to use it's value as ID in dropdown instead of default model ID field.
|
#
|
public
|
string|null
|
$titleField
Set custom model field here to display it's value in dropdown instead of default model title field.
Set custom model field here to display it's value in dropdown instead of default model title field.
|
#
|
public
|
array
|
$apiConfig = ['cache' => false]
|
#
|
public
|
array
|
$settings = []
|
#
|
public
|
(Closure($this, Model): array{value: mixed, title: mixed})|null
|
$renderRowFunction
|
#
|
public
|
bool
|
$multiple = false
|
#
|