views:

32

answers:

2

At http://jqueryui.com/demos/dialog/#modal-form, there is a sample modal dialog; when you click on "Create new user", it displays a modal dialog and fades everything but the dialog.

On my work based on that, I've specified "modal: true," and the modal dialog appears and disappears appropriately, but nothing else is greyed out; the rest of the screen looks as it looked before.

Do I need to apply additional CSS or serve up an image? A brief look at the sample source code didn't make it clear what I need to be adding so that it greys out the background.

If I need to have other static content served up, how can I serve it up under a Django /static/ tree? In other words, do I need to make /foo/ and /bar/ additional static content directories, or will it work with subdirectories of /static/?

+1  A: 

When you're passing modal:true as one of the options to ui-dialog, there should be an overlay div element created with a high z-index and a classname of ui-widget-overlay assigned to it. If you decided to write your own stylesheets rather than use one of the available ones as a template, it could just be that you need to define the ui-widget-overlay class in your stylesheets, set its opacity etc.

mitjak
Thank you; let me play with that.
JonathanHayward
I've created an overlay div with a high z-index (1000 for the div, not specified for form inputs). Both the background-color and background-image settings seem to end up behind the form inputs, not in front of them; that is, at unspecified (100%) opacity they mask the background but not foreground.
JonathanHayward
I think you misunderstood my answer: the div with the classname `ui-widget-overlay` is created dynamically by jQuery UI. All you have to do is add something like this to your stylesheets:.ui-widget-overlay { background: #000; opacity: .5;}
mitjak
I probably did misunderstand; let me try again.
JonathanHayward
Thank you; for the record, here is the CSS: .ui-widget-overlay { background: #000000; opacity: .5; position: absolute; top: 0; bottom: 0; left: 0; right: 0; z-index: 1000; }
JonathanHayward
Glad that helped. Cheerio!
mitjak
A: 

Do you have the appropriate theme files in the correct place on the server? If you aren't using a standard default theme you can create your own using jQuery UI's theme roller.

Mark
What is the correct place on the server? Can it go under /static/, or can/should I make separate root-level directories?
JonathanHayward
It can go wherever you chose as long as you point the required css file to the right place. Just make sure that whatever directory the required css theme is in, the attached images directory is there as well.So if your theme is located in /static/jquery/theme/mytheme/mytheme.cssthen your images directory for the theme would be/static/jquery/theme/mytheme/images/
Mark