In dojo I intend to use my dialog box resizable by dragging the mouse over the rightmost corner edge. Dialog as such has no property to resize it. So I try to use Floating pane and then add the dialog as child. I plan to use the resizable property of Floating Pane for the child i.e dialog. Is this approach wrong ? d = new Dialog({ title: "Testing Dialog", content: "hi" });
fp = new FloatingPane({
title: "Test",
resizable: true,
dockable: false,
style: "position:absolute;top:0;left:0;width:100px;height:100px;visibility:hidden;",
id: "fp"
}, dojo.byId("fp"));
fp.addChild(d);
fp.startup();
It really depends on what aspect of the Dialog you're trying to replicate from the FloatingPane. If, for instance you want the default action pane and/or the Dialog overlay, then perhaps it's a better idea to just extend the Dialog and add a resize handler like the Floating Pane has.
If there are more aspects of a Floating Pane you like (e.g., moveable, resizeable, locked into a parent window), then perhaps you should extend the FloatingPane and add the properties of a Dialog that you like.
Either way though, it really depends on what you're trying to accomplish with this new Dialog and what features you need. Extending either would be my suggestion. I would not, however recommend accomplishing either by placing a Dialog into a Floating Pane because I can't see how it would accomplishes what you're trying to do. If you could explain your use case more, then I can give you a more concrete example.
[Edit]
You'll probably want to look at this: http://dojotoolkit.org/reference-guide/1.10/quickstart/writingWidgets.html to learn more about how to extend widgets.
Looking at the Floating Pane code, what you'll need to do is to add a resizeHandle to your extended Dialog that looks like this:
You'll then need to initialize it by doing something like this:
Resize handle can be found at dojox/layout/ResizeHandle