Click event for SectionStack

Hi,

I can’t seem to figure out how to get an event fired when a sectionStackHeader is clicked on. When a user clicks on the sectionHeader and the stack changes I’d like to know so I can take some action…

Any help would be appreciated.

Thanks,
Marc

You probably want SectionStack.sectionHeaderClick().

What do you plan to do when a header is clicked?

Yes I kind of thought that was what I needed but I can’t seem to attach a function to that. Even something as simple as "alert(‘hello’) throws a Javascript error.

As for what I want to do.. the section stack is on the left hand side of the page. On the right is a formgrid and set of tabs which contain data associated with items in the formgrid. When the section stack on the left is changed some context changes on the rights as well and I’d the ability to all filterdata on the formgrid and show/hide some of the tabs.

Marc

Hi Marc,
2 things you need to know here:

1: This property is expected to be a method, not a string of script - so rather than using the string “alert(‘hello’)”, you would need to set your sectionHeaderClick to a function that calls alert(“hello”).

2: The default implementation of this method is what opens/closes sections on header-click, so to get the standard behavior to fire you need to call this.Super(…) as part of your method. This will invoke the default implementation of the method.

Here’s an example:

isc.SectionStack.create({
    sectionHeaderClick : function (section) {
        alert("Hello!");
        return this.Super("sectionHeaderClick", arguments);
    },
    ... other properties for the section stack
});