开发者

Using jquery datepicker in modal window

开发者 https://www.devze.com 2023-02-28 16:17 出处:网络
Hi I\'m creating modal windows using rails 3, jquery and ajax. The idea is in order to edit objects or create new ones, the window pops up, you edit or create whatever you need and that\'s it.

Hi I'm creating modal windows using rails 3, jquery and ajax. The idea is in order to edit objects or create new ones, the window pops up, you edit or create whatever you need and that's it.

However I also want to use 开发者_如何学Godatepicker from jquery, inside the modal window. Everything works fine and the calendar pops up when I need it... as long as is not in the modal window. The reason seems to be that when the window pops up, and I check the source code... there's nothing, is as if it doesn't exist, it just shows me whatever is behind the window.

Does this make any sense or has anyone come across something similar?


I believe this is an issue in the CSS for the datepicker. I remember that I had a similar issue and the dialog box had a higher z-index in the CSS than the datepicker. If you go in to the CSS for the datepicker in jQuery and set the z-index value higher, it should show up in the modal dialog.

UPDATE:
If you go into the CSS file of the theme you are using (jquery-ui-1.8.12.custom.css is an example) and then go to line 510 you can replace the line with this

.ui-datepicker { z-index: 1002; width: 17em; padding: .2em .2em 0; display: none; }
0

精彩评论

暂无评论...
验证码 换一张
取 消