Alien-GvaScript
view release on metacpan or search on metacpan
lib/Alien/GvaScript/AutoCompleter.pod view on Meta::CPAN
=head2 Options
The options to construct an autocompleter object are :
=over
=item minimumChars
How many characters are needed before trying to find suggestions.
=item labelField
Name of the field that contains the HTML to display
(default is C<label>).
=item valueField
Name of the field that contains the value to put in input element
(default is C<value>).
=item autoSuggest
Boolean value; toggles whether suggestions are displayed automatically
when available (true by default). If false, suggestions are only
displayed when the C<ARROW_DOWN> key is pressed.
=item autoSuggestDelay
How many milliseconds to wait after a keypress before displaying
suggestions. Default is 200.
=item typeAhead
If true (the default), the current suggestion will be automatically
inserted into the input element.
=item maxHeight
Maximum height for the suggestion DIV (in pixels).
Default is 200.
=item minWidth
Minimum width for the suggestion DIV (in pixels)
Default is 200.
=item offsetX
Offset (in pixels) from the left border of the
input element to the left border of the
suggestion DIV.
Default is 0.
=item strict
If this option is true and the user
leaves the field with an illegal value
(not in the suggestion list),
the field is marked with a red background.
Default is false.
=item blankOK
If this option is defined and false,
the field is marked with a red background
when left with an empty value.
Default is true.
=item ignorePrefix
If true, and if the datasource is a Javascript array, then
that whole array is always displayed as suggestions,
whatever may be typed in the input field (so the field
behaves more or less like a SELECT).
Default is false.
=item caseSensitive
This option only applies if the datasource is a Javascript array
and if C<ignorePrefix> is false.
If true (the default), filtering of the datasource array
from the current value of the input field
will be case-sensitive.
=item colorIllegal
Which color to put in the background when a "strict" field contains
an illegal value (default is red).
=item scrollCount
How many items to skip when hitting the
C<PAGE_UP> or C<PAGE_DOWN> keys.
Default is 5
=item htmlWrapper
See the C<ChoiceList> documentation.
=item choiceItemTagName
See the C<ChoiceList> documentation.
=item classes
Classes that will be assigned at various stages
to autocompleter DOM elements .
Possible classes are
=over
=item loading
Class added to the input or textarea field while an Ajax
request is pending. Default is C<AC_loading>, a class that displays
an Ajax-loading icon.
=item dropdown
Class for the dropdown div that displays the autocompletion choices.
Default is C<AC_dropdown>.
=item message
Class for displaying warning messages.
Default is C<AC_message>.
=back
=item additional_params
Other parameters to be added in the Ajax query for autocompletion.
Can be either an array or an already encoded string (see C<Ajax.Options> in
C<prototype.js>).
[TODO: should be camelCase to be consistent with other options;
check dependencies in DMWeb].
=item dependentFields
var ac = new GvaScript.Autocompleter(url, {
dependentFields : {
foo : "firstname",
bar : "lastname",
( run in 1.183 second using v1.01-cache-2.11-cpan-fe3c2283af0 )