Alien-GvaScript

 view release on metacpan or  search on metacpan

lib/Alien/GvaScript/ChoiceList.pod  view on Meta::CPAN

=item labelField

Name of the field that contains the HTML to display
(default is C<label>).

=item idForChoices

Prefix that will be used to generate ids for choice elements in
the generated HTML. The default is C<CL_choice>, so choice elements
will have ids C<CL_choice.0>, C<CL_choice.1>, etc.

=item keymap

If defined, the choiceList will add rules to the supplied keymap,
instead of creating a new one.

=item scrollCount

How many items to skip when hitting the 
C<PAGE_UP> or C<PAGE_DOWN> keys. 
Default is 5

=item mouseovernavi 

Boolean indicating whether the choices would be selected/deselected with the 
mouseover event.
Default is C<true>

=item classes

Classes that will be assigned to choice elements in the generated
HTML. Possible classes are C<choiceItem> (default value C<CL_choiceItem>) and
C<choiceHighlight> (default value C<CL_highlight>).


=item htmlWrapper

Callback function for generating HTML for the choiceList.
This function is called with some pre-built HTML containing
all current choices; the wrapper has a chance to modify 
that HTML for example for adding classes, borders or 
table headers. Default is the identity function.


=item choiceItemTagName

HTML tag name for generating a choice entry in the choice list.
Default is "div". Set it to "tr" if you want the choice list
to be displayed as a table (but then you also have to 
open and close the table within the C<htmlWrapper> callback).


=back

=head1 METHODS

=head2 destroy

  choiceList.destroy();

This method removes all handlers attached to different
events on the choice list container.
Call this method when the choice list container is removed
from the DOM.

=head2 fillContainer

  choiceList.fillContainer(someDiv);

This method generates HTML from the choice list, and inserts
it in the C<innerHTML> of the supplied container; furthermore,
it registers a keymap on that container in order to manage navigation
from keyboard (C<DOWN>, C<UP>, etc.).


=head1 EVENTS

=head2 onHighlight

This event is triggered when a choice in the list is highlighted.
The event handler may use C<event.index> to know the index of the
highlighted choice.

=head2 onPing

This event is triggered when a choice in the list is "ping-ed", i.e.
either by clicking or by pressing the C<RETURN> key.
Usually this means "select", but it is up to the event handler to decide
how to interpret the event.
The event handler may use C<event.index> to know the index of the
ping-ed choice.


=head2 onCancel

This event is triggered when the user presses the C<ESCAPE> key.



( run in 0.907 second using v1.01-cache-2.11-cpan-524268b4103 )