public class Dataset
extends de.agilecoders.wicket.jquery.AbstractConfig
| Modifier and Type | Method and Description |
|---|---|
Remote |
getRemote() |
Dataset |
withEngine(de.agilecoders.wicket.jquery.util.Json.RawValue engine)
The engine used to render suggestions.
|
Dataset |
withFooter(String footer)
The footer rendered before suggestions in the dropdown menu.
|
Dataset |
withHeader(String header)
The header rendered before suggestions in the dropdown menu.
|
Dataset |
withLimit(int limit)
The key used to access the value of the datum in the datum object.
|
<T> Dataset |
withLocal(List<T> local)
A static list of datums.
|
Dataset |
withName(String name)
The string used to identify the dataset.
|
Dataset |
withPrefetch(Prefetch prefetch)
Prefetched data is fetched and processed on initialization.
|
Dataset |
withRemote(Remote remote)
Can be a URL to fetch suggestions from when the data provided by local and prefetch is insufficient or, if more configurability is needed, a remote options object.
|
Dataset |
withTemplate(String template)
The template used to render suggestions.
|
Dataset |
withValueKey(String valueKey)
The key used to access the value of the datum in the datum object.
|
public Dataset(String name)
public Dataset withName(String name)
The string used to identify the dataset. Used by typeahead.js to cache intelligently.
name - mandatory parameterpublic Dataset withValueKey(String valueKey)
The key used to access the value of the datum in the datum object. Defaults to value.
valueKey - mandatory parameterpublic Dataset withLimit(int limit)
The key used to access the value of the datum in the datum object. Defaults to value.
limit - mandatory parameterpublic Dataset withTemplate(String template)
The template used to render suggestions. Can be a string or a precompiled template. If not provided, suggestions will render as their value contained in a
element (i.e.
value
).template - mandatory parameterpublic Dataset withEngine(de.agilecoders.wicket.jquery.util.Json.RawValue engine)
The engine used to render suggestions. Can be a string or a precompiled engine. If not provided, suggestions will render as their value contained in a
element (i.e.
value
).Example: #withEngine(new Json.RawValue(“Hogan”))
engine - mandatory parameterpublic Dataset withHeader(String header)
The header rendered before suggestions in the dropdown menu. Can be either a DOM element or HTML.
header - mandatory parameterpublic Dataset withFooter(String footer)
The footer rendered before suggestions in the dropdown menu. Can be either a DOM element or HTML.
footer - mandatory parameterpublic Dataset withRemote(Remote remote)
Can be a URL to fetch suggestions from when the data provided by local and prefetch is insufficient or, if more configurability is needed, a remote options object.
remote - mandatory parameterpublic Dataset withPrefetch(Prefetch prefetch)
Prefetched data is fetched and processed on initialization. If the browser supports localStorage, the processed data will be cached there to prevent additional network requests on subsequent page loads.
prefetch - Prefetched data is fetched and processed on initialization.public <T> Dataset withLocal(List<T> local)
A static list of datums.
local - A static list of datums..public Remote getRemote()
Copyright © 2011–2014 AgileCoders. All rights reserved.