Alien-GvaScript

 view release on metacpan or  search on metacpan

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

is given, returns the last node of the tree.

=item C<lastVisibleSubNode(node)>

Returns the last visible subnode (recursively) of the argument
node. If no argument is given, returns the last visible subnode of the
tree.

=item C<label(node)>

Returns the label of that node, i.e. the first HTML child element
having class C<TN_label>.

=item C<content(node)>

Returns the content of that node, i.e. the last HTML child element
having class C<TN_content>.

=item C<nextDisplayedNode(node)>

Returns the next tree node in page display order (i.e. next visible
node down the page).

=item C<previousDisplayedNode(node)>

Returns the previous tree node in page display order (i.e. previous
visible node up the page).

=item C<enclosingNode(elem)>

Returns the first tree node that contains the given element
(which might be for example a form input).

=back

=head2 Event handling

Manipulations to the tree generate I<events>
for which clients can register some I<handlers>,
exactly like ordinary HTML events.


=head3 Event list

=head4 C<Select> / C<Deselect>

triggered when a node is marked / unmarked as the
currently selected node. Both events are not
triggered immediately, but only after 
C<selectDelay> milliseconds have elapsed :
this is an optimization to avoid too many calls
while the user is navigating quickly through the
nodes; in other words, intermediate nodes
crossed while navigating the tree will not
receive any trigger.

If label selection is associated with 
focus (i.e. if C<tabIndex> was not set
to -1), then selection/deselection events
are also triggered when the user switches
to another desktop window.


=head4 C<Open> / C<Close>

triggered when a node is opened or
closed


=head4 C<BeforeLoadContent> / C<AfterLoadContent>

triggered before/after a node's content
is loaded from an URL (throug opening the node,
or hitting the C<Ctrl-R> key) -- see
the section below about dynamic tree
updates).

=head4 C<inspect>


triggered when a user calls the
I<inspector> for a node (either by
hitting the RETURN key or by
double-clicking the node's label)

=head3 Event structure passed to handlers

Handlers can access an C<event> structure,
similar to what is passed to ordinary HTML events;
the entries are:

=over 

=item C<type>

the name of the triggered event
(i.e. C<Select>, C<Deselect>, C<Open>, etc.)

=item C<target>

the node element on which the event was
triggered

=item C<srcElement>

synonym for C<target>

=item C<treeNavigator>

the tree navigator object controlling the
target node

=back


=head3 Registering event handlers

Event handlers can be registered in several ways:

=head4 additional attributes on node elements



( run in 0.709 second using v1.01-cache-2.11-cpan-119454b85a5 )