Opened 12 years ago

Closed 8 years ago

#3214 closed enhancement (wontfix)

StackContainer: publish event for unselect

Reported by: guest Owned by: bill
Priority: high Milestone: future
Component: Dijit Version: 0.9
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

Hi dojo team,

Two enhancement proposal regarding StackContainer:

First idea:

when the 'selectChild' method of StackContainer is called, the following event is published:

dojo.event.topic.publish(this.widgetId+"-selectChild", page);

It would be interesting to have a similar event published just before changing with the old page, e.g.

dojo.event.topic.publish(this.widgetId+"-unselectChild", this.selectedChildWidget);

This would allow the developer to take action such as stopping a timer, or changing the focus...

Second idea:

Another idea would be to programmatically be able to reject the request to change the current page is some condition is not met (data not saved...)

Thanks

Yann

Change History (9)

comment:1 Changed 12 years ago by bill

Component: GeneralDijit
Milestone: 1.0
Owner: changed from anonymous to Adam Peller

Sounds reasonable.

Also, I'm wondering if we should just have one event (named after the widget id) that has a field specifying a subtype (startup, select, deselect, addChild, removeChild)

comment:2 Changed 12 years ago by bill

Milestone: 1.01.1

comment:3 Changed 11 years ago by Adam Peller

Milestone: 1.12.0

comment:4 Changed 11 years ago by alex

Milestone: 2.01.3

Milestone 2.0 deleted

comment:5 Changed 10 years ago by Adam Peller

Description: modified (diff)
Milestone: 1.3future

comment:6 Changed 8 years ago by Adam Peller

Owner: Adam Peller deleted

assigning all Dijit bugs to Bill

comment:7 Changed 8 years ago by Chris Mitchell

Owner: set to bill

comment:8 Changed 8 years ago by bill

Description: modified (diff)
Summary: enhancement request:: page container should publish an event for unselectStackContainer: publish event for unselect

Hmm, well

StackContainer.watch("selectedChild", function(name, o, n){ ... })

will tell you the old child and the new child, but it's not exactly the same since the timing probably happens after the transition is complete.

I'm moving away from the subscribe/publish model for notification, but consider adding a notificatication like

StackContainer.on("unselect-child", ...)

comment:9 Changed 8 years ago by bill

Resolution: wontfix
Status: newclosed

Besides watch()'ing StackContainer.selectedChild, you can also watch "selected" for an individual child. Given that I want to move away from topics in 2.0 anyway, I think that's enough.

Note: See TracTickets for help on using tickets.