Opened 10 years ago

Closed 10 years ago

#10573 closed enhancement (wontfix)

[patch][cla]Support for suspend/resume in a widget

Reported by: iDo Owned by:
Priority: high Milestone: tbd
Component: Dijit Version: 1.4.0
Keywords: suspend resume dijit._Widget Cc:
Blocked By: Blocking:

Description

Add support to all dijit._Widget for suspend / resume themselves (and their descendants). When suspended a widget will be like a zombi. All methods will return false. Additionally, suspend() allow you to determine some persistants methods.

Attachments (1)

_Widget.patch (4.7 KB) - added by iDo 10 years ago.

Download all attachments as: .zip

Change History (5)

Changed 10 years ago by iDo

Attachment: _Widget.patch added

comment:1 Changed 10 years ago by iDo

Usage :

//suspend a widget
myWidget.suspend(true);
//resume a widget
myWidget.suspend(false);


//suspend a widget and its decendants
myWidget.suspendRecursive(true);
//resume a widget and its decendants
myWidget.suspendRecursive(false);

And you can use the property "preserveFromSuspend" (array) to preserve some methods

comment:2 Changed 10 years ago by bill

Component: GeneralDijit
Owner: anonymous deleted

What's the reason for such functionality? I'm not sure how many people want to "suspend" a widget. It sounds like the same thing as disabling a widget, which is supported for form widgets (with a visual change), although not other widgets.

comment:3 in reply to:  2 Changed 10 years ago by iDo

Replying to bill:

What's the reason for such functionality? I'm not sure how many people want to "suspend" a widget. It sounds like the same thing as disabling a widget, which is supported for form widgets (with a visual change), although not other widgets.

Sometime we have to hide a widget. And when we show it again, a dojo.publish, a resize, a dojo.connect could have modified its state. The goal is to ensure the widget will be the same as it was before hiding. Indeed, it's like "disabled" but it's disable for code action not for user action.

comment:4 Changed 10 years ago by bill

Resolution: wontfix
Status: newclosed

Thanks. I'll keep this mind but I'm not going to check it in at the current time, because I haven't heard others asking for this functionality, and we need to keep dijit lean. I suspect also that the code could be simplified by using the dojox AOP code (which will hopefully be moved into dojo core soon).

Note: See TracTickets for help on using tickets.