Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#7312 closed defect (fixed)

FloatingPane.onClose is never called

Reported by: enzo Owned by: dante
Priority: high Milestone: 1.2
Component: DojoX Widgets Version: 1.1.1
Keywords: Cc: dante
Blocked By: Blocking:

Description

It appears that the onClose() method is not invoked upon closure of a FloatingPane?. I have found two alternatives:

1) Explicitly connect the "close" method to "onClose":

dojo.connect(fltpane, "close", fltpane, "onClose");

Unfortunately, close() leaves some debris in the DOM, as revealed by Firebug:

<div id="dojox_layout_FloatingPane_0" class="dojoxFloatingPane dijitContentPane dojoxFloatingPaneFg" title="" widgetid="dojox_layout_FloatingPane_0" role="group" style="position: absolute; top: 96.7px; left: 495.2px; width: 310px; height: 332px; z-index: 100; opacity: 0; display: none; visibility: hidden;"> </div> <div id="dojox_layout_FloatingPane_1" class="dojoxFloatingPane dijitContentPane dojoxFloatingPaneFg" title="" widgetid="dojox_layout_FloatingPane_1" role="group" style="position: absolute; top: 97px; left: 494px; width: 310px; height: 332px; z-index: 100; opacity: 0; display: none; visibility: hidden;">

(every new open/close cycle creates one of the DIVs above, shown as dimmed out by Firebug).

2) Replace the stock close() with the following brutal code:

fltpane.close = function() {

if(!this.closable){ return; } place here what would go in onClose()... ... this.destroyRecursive();

};

The second alternative seems to work fine removing all traces of DOM elements.

Change History (4)

comment:1 Changed 11 years ago by dante

Resolution: fixed
Status: newclosed

(In [14964]) fixes #7312 - passing just a hitched function wasn't destroying for some reason. wrapping it in an function however seems to clean it up. there is no onClose that I can see that should be fired, so simply connecting to .close() method should be sufficient now. please file an additional enhancement request is there is a better usecase for onClose stub, it would be trivial to implement.

comment:2 Changed 11 years ago by bill

Milestone: tbd1.2

comment:3 in reply to:  2 Changed 11 years ago by enzo

Replying to bill: I can live without a onClose, but in that case the API documentation should be fixed: at http://api.dojotoolkit.org/jsdoc/dojox/HEAD/dojox.layout.FloatingPane the onClose method is said to exist (namely, to be "Defined by dijit._Widget", which appears to support some claim of inheritance).

comment:4 Changed 11 years ago by dante

@enzo - this is a caveat of the API parser and Dijit structure. Sometimes other widgets mix properties into _Widget, thus making anything that inherits from _Widget appear to have that method in the API docs. Eg: "region" is added by BorderContainer?, but the region param is only ever used by BC, but needs to be allowed on _Widget so any widget can be a child of BorderContainer?.

creating a FloatingPane?.onClose method would do nothing but add code and additonal function calls, though it would make the naming slightly more consistent. If you really feel it important, I encourage you to create a patch against SVN and open a new enhancement ticket.

Note: See TracTickets for help on using tickets.