Dijit dialog positioning

5486
2
05-25-2015 01:10 PM
RyanSmith1
New Contributor III

Hi guys i'm using a dijit dialog and have populated it with certain controls and i've set an initial style and positioning to it but when i resize the browser window the dialog positions changes, it stretches all the way to the center which i assume is the default position of the dijit dialog. How can i prevent this from occurring?

Below is the code I've used to perform the styling.

                            dojo.style(searchDialog.domNode, 'visibility', 'hidden');
                            searchDialog.show().then(function () {
                             dojo.style(searchDialog.domNode, 'top', '10px');
                                dojo.style(searchDialog.domNode, 'right', '40px');
                                dojo.style(searchDialog.domNode, 'left', '');
                                dojo.style(searchDialog.domNode, 'visibility', 'visible');
                            });

                             

Thanks,

Ryan

0 Kudos
2 Replies
RickeyFight
MVP Regular Contributor

Ryan,

What I always do is use chrome developer tools.

This way I can see the css and modify it in the browser to make it look the way I want. I then copy the css to my script.

Here is a link to how to use developer tools:

Chrome DevTools Overview - Google Chrome

0 Kudos
RyanSmith1
New Contributor III

Hi Rickey, thanks for your response. I've been using firebug to monitor the css on the application. I managed to resolve this by using domStyle.set() instead of dojo.style() and afterwards i called the dialog._endDrag() which stations the dialog to the defined position when the window is resized.