Alien-GvaScript
view release on metacpan or search on metacpan
doc/html/ChoiceList.html view on Meta::CPAN
<h3 class="TN_label">Options</h3>
<div class="TN_content">
<p>The options to construct an choiceList object are :</p>
<ul>
<li><a name="item_labelField"></a><b>labelField</b>
<p>Name of the field that contains the HTML to display
(default is <code>label</code>).</p>
</li>
<li><a name="item_idForChoices"></a><b>idForChoices</b>
<p>Prefix that will be used to generate ids for choice elements in
the generated HTML. The default is <code>CL_choice</code>, so choice elements
will have ids <code>CL_choice.0</code>, <code>CL_choice.1</code>, etc.</p>
</li>
<li><a name="item_keymap"></a><b>keymap</b>
<p>If defined, the choiceList will add rules to the supplied keymap,
instead of creating a new one.</p>
</li>
<li><a name="item_scrollCount"></a><b>scrollCount</b>
<p>How many items to skip when hitting the
<code>PAGE_UP</code> or <code>PAGE_DOWN</code> keys.
Default is 5</p>
</li>
<li><a name="item_mouseovernavi"></a><b>mouseovernavi</b>
<p>Boolean indicating whether the choices would be selected/deselected with the
mouseover event.
Default is <code>true</code></p>
</li>
<li><a name="item_classes"></a><b>classes</b>
<p>Classes that will be assigned to choice elements in the generated
HTML. Possible classes are <code>choiceItem</code> (default value <code>CL_choiceItem</code>) and
<code>choiceHighlight</code> (default value <code>CL_highlight</code>).</p>
</li>
<li><a name="item_htmlWrapper"></a><b>htmlWrapper</b>
<p>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.</p>
</li>
<li><a name="item_choiceItemTagName"></a><b>choiceItemTagName</b>
<p>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 <code>htmlWrapper</code> callback).</p>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="TN_node" id="METHODS">
<h2 class="TN_label">METHODS</h2>
<div class="TN_content">
<div class="TN_node" id="destroy">
<h3 class="TN_label">destroy</h3>
<div class="TN_content">
<pre> choiceList.destroy();</pre>
<p>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.</p>
</div>
</div>
<div class="TN_node" id="fillContainer">
<h3 class="TN_label">fillContainer</h3>
<div class="TN_content">
<pre> choiceList.fillContainer(someDiv);</pre>
<p>This method generates HTML from the choice list, and inserts
it in the <code>innerHTML</code> of the supplied container; furthermore,
it registers a keymap on that container in order to manage navigation
from keyboard (<code>DOWN</code>, <code>UP</code>, etc.).</p>
</div>
</div>
</div>
</div>
<div class="TN_node" id="EVENTS">
<h2 class="TN_label">EVENTS</h2>
<div class="TN_content">
<div class="TN_node" id="onHighlight">
<h3 class="TN_label">onHighlight</h3>
<div class="TN_content">
<p>This event is triggered when a choice in the list is highlighted.
The event handler may use <code>event.index</code> to know the index of the
highlighted choice.</p>
</div>
</div>
<div class="TN_node" id="onPing">
<h3 class="TN_label">onPing</h3>
<div class="TN_content">
<p>This event is triggered when a choice in the list is "ping-ed", i.e.
either by clicking or by pressing the <code>RETURN</code> 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 <code>event.index</code> to know the index of the
ping-ed choice.</p>
</div>
</div>
<div class="TN_node" id="onCancel">
<h3 class="TN_label">onCancel</h3>
<div class="TN_content">
<p>This event is triggered when the user presses the <code>ESCAPE</code> key.</p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
( run in 1.458 second using v1.01-cache-2.11-cpan-524268b4103 )