Alien-GvaScript
view release on metacpan or search on metacpan
lib/Alien/GvaScript/ChoiceList.pod view on Meta::CPAN
=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.931 second using v1.01-cache-2.11-cpan-4991d5b9bd9 )