[ic] TIPS AND TRICKS: Tree example

interchange-users@interchange.redhat.com interchange-users@interchange.redhat.com
Fri Sep 21 18:04:00 2001


Quoting Eduardo Dominguez (edmz@yahoo.com):
> Thanks for the great example :)
> 
> Works nicely.
> 
> With the current code, is it possible to make the tree only
> display one exploded branch ? (eg, you click on a non exploded
> branch and if there was one exploded it collapses).

Nope, but it is possible. You would have to check the $CGI->{toggle},
and if it is present and is a toplevel entry, delete the
$Scratch->{memo} structure entirely. This would have to
happen above the tree call. I think this would work:

[if cgi toggle]
    [calc]
	my $par = '[data table=tree col=parent_fld key="[cgi toggle]"]';
	delete $Scratch->{memo} if $par eq 'TOP';
	return;
    [/calc]
[/if]

-- 
Red Hat, Inc., 3005 Nichols Rd., Hamilton, OH  45013
phone +1.513.523.7621      <mheins@redhat.com>

Unix version of an Outlook-style virus:
It works on the honor system. Please forward this message to everyone
you know, and delete a bunch of your files at random.