How to position jazz.ui.Dialog ?
![](http://jazz.net/_images/myphoto/e0508a30347adb779ba17ee260c1ca70.jpg)
Hi,
Now I want to position a jazz.ui.Dialog to a relative position. I saw the api :
https://jazz.net/wiki/bin/view/WebUIBook/DialogWidget
So I made
this.dialog = new jazz.ui.Dialog({
contentNode: this.contentNode,
primaryTitle: this.messages.Notice_1,
width: this.width,
left:'30%',
top:'10%',
destroyContents: true,
center: false
});
It doesn't work, so how to position a Dialog ? thanks.
Now I want to position a jazz.ui.Dialog to a relative position. I saw the api :
https://jazz.net/wiki/bin/view/WebUIBook/DialogWidget
So I made
center
false like this :
this.dialog = new jazz.ui.Dialog({
contentNode: this.contentNode,
primaryTitle: this.messages.Notice_1,
width: this.width,
left:'30%',
top:'10%',
destroyContents: true,
center: false
});
It doesn't work, so how to position a Dialog ? thanks.
One answer
![](http://jazz.net/_images/myphoto/e0508a30347adb779ba17ee260c1ca70.jpg)
After look at the js file for jazz.ui.Dialog, the center variable has this jsdoc attached to it:
/**
* Specify whether the Dialog should be positioned in the center of the window. If false, the
* consumer is responsible for appending the dialog to the DOM.
* @type Boolean
* @default true
*/
center: true,
So this means you will need to attach the dialog to the dom yourself. So your code would have to look more like:
this.dialog = new jazz.ui.Dialog({
contentNode: this.contentNode,
primaryTitle: this.messages.Notice_1,
width: this.width,
destroyContents: true,
center: false
});
this.domNode.appendChild(this.dialog);
/**
* Specify whether the Dialog should be positioned in the center of the window. If false, the
* consumer is responsible for appending the dialog to the DOM.
* @type Boolean
* @default true
*/
center: true,
So this means you will need to attach the dialog to the dom yourself. So your code would have to look more like:
this.dialog = new jazz.ui.Dialog({
contentNode: this.contentNode,
primaryTitle: this.messages.Notice_1,
width: this.width,
destroyContents: true,
center: false
});
this.domNode.appendChild(this.dialog);