30 Days of Mootools 1.2 Tutorials - Day 17 - Accordion -- consider :: For do what i want, we can make that accordion closes manually with the onclick event in elements without children. I don't know if you are understanding me http://www.consideropen.com/blog/2008/09/30-days-of-mootools-12-tutorials-day-17-accordion/HOME | Hi folks...
I have a showstopper problem that I'm trying to overcome. Simply stated, I need to fire a function any time a new Accordion pane is selected. If my read of the docs is correct, the Accordion exposes no events at all, and I've tracked back up the entire inheritance tree and none of its ancestors seems to either. Am I missing something?
This stops me dead in my tracks frankly because I foolishly got pretty far into a project assuming such an event was available (I should have confirmed that first), but it doesn't look like I can do it. Although I can think of some hacks (like a TaskRunner with a short interval that interrogates the Accordion's activeItem property and calls my function when it's changed), but they're ugly answers to be sure and I'd like something clean and proper. EventShopper.Com by Sevari LLC - Event Service Providers and :: Musicians trained to play the accordion. Depending on your event, accordion players can play a range of music from the popular to the classical. Live Music! http://www.eventshopper.com/vendc182-accordion-players.htmlHOME | Cotati Accordion Festival 2006 Event:: Saturday's Events August 23th, 2008 The Golden State Accordion Club(stage one). 10:20-10:50. Sunday's Events August 24th, 2008 http://www.cotatifest.com/2008Ev.htmHOME |
Thank in advance,
Frank Zammetti
FYI, I don't know if I'm allowed to say at this point frankly, but this is for a project that would I think be very interesting to the Ext JS community... if anyone recognizes my name you can take a pretty good guess what that project is :)
Perfect, that works like a charm, thank you! As it turns out, while waiting for a reply I found the listeners config option, which I hadn't noticed before, and was just starting to go down that route, but you saved me the effort so I appreciate it! :)
Frank
You'd need to listen to the expand event of the child panels in the accordion, you could do something like:
myAccordion.add(myFunc('myTitle'));
function myFunc(title)
{
return new Ext.Panel(
{
title: title,
listeners: { 'expand': {fn: something, scope: foo}}
}
);
}
Tops. It would be handy if the accordion did have a 'change' event similar to the tab panel though. I'll check it out later to see how difficult it will be to add it.
Heres my question?
Why would someone get bored with doing IT for 10 years?
|