I was just extending the dialog for a custom widget and noticed that if I resized my browser window the dialog no longer remains in the central position in the browser window (something it used to do).
postCreate: function(){
dojo.body().appendChild(this.domNode);
this.inherited("postCreate",arguments);
this.domNode.style.display="none";
this.connect(this, "onExecute", "hide");
this.connect(this, "onCancel", "hide");
this.connect(window,'onresize',"_position");
},
dojo.body().appendChild(this.domNode);
this.inherited("postCreate",arguments);
this.domNode.style.display="none";
this.connect(this, "onExecute", "hide");
this.connect(this, "onCancel", "hide");
this.connect(window,'onresize',"_position");
},
I was able to extend the postCreate method to include this resize:reposition relationship.
Was there a reason it was taken out of the dialog's? Anyone see any issues with the code I'm using above?

I've asked bill about this
I've asked bill about this before. It gets complicated. It repositions onScroll, to be centered, but is draggable too. So if you drag it (eg wanted it offset for some reason), when you scroll (or now resize) it will be centered again.
Bill's solution, iirc, was to make it do neither. Doing both, (all, including leaving it offset onScrol or resize) would probably add bloatyness. Not much, but some.
I want a dojox.Dialog with all these extra features, but don't like how difficult it would be to maintain a dialog with a dojox.layout.ContentPane as it's baseclass.
Right I saw that it
Right I saw that it repositions after a scroll, which was why I was confused that it didn't also do that for a resize. Seemed weird to do one but not the other, especially considering how small the code is to add the resize:reposition (if my example does do what I think it does).
I actually didn't realize it could be DND'd, as I'd extended it and removed the DND functionality not knowing it was there. Wasn't until I checked the test that I noticed it.
Programmatic Toolbar creation
hi!
write a code for create programmatic tool bar code is bellow
dojo.addOnLoad(function() {
parentNode = dojo.byId('barParent');
var barDiv = document.createElement ("div");
var attachedBarDiv = parentNode.appendChild(barDiv);
var adBar = new dijit.Toolbar ({},attachedBarDiv);
});
Or the slimmer:
dojo.addOnLoad(function() {
adBar = new dijit.Toolbar ({});
dojo.place(adBar.domNode, dojo.byId('barParent'), "first");
});
how i keep inside my button as bold,cut,copy,paste in Tool bar....
yes
Yes, that's by design, because if the user moves the dialog and then resizes the browser window they may not want the dialog to re-center itself.
I see the logic, but it's inconsistent
Whilst I see that logic, it's strange that it doesn't act the same way with the scrolling. If you reposition the popup and the scroll, it jumps back to the center of the screen.
Why do one without the other. Or do both and make it a variable that can be toggled, or make it so it only repositions if you don't have DND enabled.
my solution...
Hi all,
i extended dialog and after create i "disable" _position function.
When i resize browser i check if dialog is visible and if not i recenter it based on new working area size.