modal-dialog

Angular modal dialog best practices

荒凉一梦 提交于 2019-12-03 14:53:54
What is the best practice for creating modal dialogs with dynamic content, contrasted with dialogs that don't have dynamic content. Eg.. We have some modal forms that accept a list of form elements, and have submit/cancel. Also, there are modal dialogs that just display a confirm/ok type of operation. I've seen a lot of people saying that dialogs should be services passed into the controller, but it seems to me that services shouldn't be rendering UI components and manipulating the DOM. What is the best practice for assembling these two types of dialogs? Thanks. Angular UI Boostrap provides a

Close modal window containing ASP MVC Ajax form

一世执手 提交于 2019-12-03 14:42:45
问题 in a webapp I'm using an ASP MVC Ajax form in a modal window. I do not use any specific jQuery code, only some to open the modal window (i.e. showModal() function): @Ajax.ActionLink("Open", "Add", "Home", new {id = Model.Id}, new AjaxOptions { HttpMethod = "GET", UpdateTargetId = "modal", OnSuccess = "showModal()"}) This code loads my form (partial view) into a div and opens it as a modal window. In the form submit ActionResult I just use the default ModelState object to validate it, and in

Open URL on Bootstrap Modal close

帅比萌擦擦* 提交于 2019-12-03 14:27:46
Maybe I'm brain dead here, but I'm trying to do what seems should be an easy thing. I am using Bootstrap to open a modal on page load depending on the value of specific variables. This all works great. However, when the modal opens and the user clicks ok (presumably after reading the info text), I want to page to redirect to a new page. I can't seem to figure out how to do this. Any info on how to do Along the lines of @Knagis additional option, you can use onclick to change the window.location, and the data-dismiss=modal attribute in the same link.. <a href="" data-dismiss="modal" onclick=

How to close all active bootstrap modals on session timeout?

冷暖自知 提交于 2019-12-03 14:25:24
问题 I need to make a call when the user is idle and passes the session time out that will close all Bootstrap modals. The modals being active are dependent on what the user is doing at the time so I would like to do something that's is all encompassing. I tried: $('.modal').modal('toggle'); When the time out occurs but my modals are still there. 回答1: Use the following code: $('.modal').modal('hide'); Also if you would like to do something if the modal is hidden then you can do this: $('.modal')

ASP.NET MVC Login Modal Dialog/lightbox

偶尔善良 提交于 2019-12-03 14:15:35
问题 I was hoping to create a lightbox/modal dialog for login into my website which is built with asp.net mvc. However the only way i can think of is to put logic into the onClick events for the hyperlinks when linking to restricted sections. I would prefer it so I could still use the Authrisation action filter, and when you click on a link to a action method which requires authrisation it would show the lightbox/modal dialog before proceding on to the actual link. The reason for this is i don't

How to close modal window extjs when clicking on mask?

半城伤御伤魂 提交于 2019-12-03 12:42:53
问题 If I create a modal window: Ext.define('myWindow', { extend: 'Ext.Container', alias: 'widget.myWindow', floating: true, modal: true, listeners: 'onMaskClick???': { close the window } ..... } How do I know when a user has clicked on the mask outside the window? In Sench Touch, there is a config hideOnMaskTap that lets me specify. What is the event/config for extJS? 回答1: Tramway's case (sort of) works on modal or non modal windows. But not in case child components like the boundlist of a

jQuery 'on' not registering in dynamically generated modal popup

▼魔方 西西 提交于 2019-12-03 12:40:29
I was under the impression that jQuery's on event handler was meant to be able to 'listen' for dynamically created elements AND that it was supposed to replace the behavior of live . However, what I have experienced is that using on is not capturing the click event whereas using live is succeeding! The tricky aspect of my situation is that I am not only dynamically creating content but I'm doing it via an AJAX .get() call, and inserting the resultant HTML into a modal .dialog() jQueryUI popup. Here is a simplified version of what I was trying to accomplish (wrapped in $(document).ready(...) ):

How to open ModalDialog on PageLoad

旧街凉风 提交于 2019-12-03 12:39:20
How can I open a modal dialog on PageLoad() , in the constructor of the WebPage and without the AjaxRequestTarget , with Wicket? I couldn't find a way to open it without an Ajax request, but it's perfectly possible to open it when the page is loaded, with a simple behavior: HomePage.java public class HomePage extends WebPage { public HomePage(PageParameters pageParameters) { super(pageParameters); ModalWindow modal = new ModalWindow("modal"); modal.add(new OpenWindowOnLoadBehavior()); modal.setPageCreator(new ModalWindow.PageCreator() { @Override public Page createPage() { return new

Difference between .Owner property and ShowDialog(IWin32Window owner)?

流过昼夜 提交于 2019-12-03 12:32:25
问题 I presume a winform's owner can be set explicitly via the .Owner property OR by passing the owner in the overloaded method ShowDialog(IWin32Window owner) I am unable to understand why these methods exhibit different behavior when working with MDI forms . I have created an MDIParent and an MDIChild. I also have a simple winform MyDialogBox that displays its owner on load. MessageBox.Show("Dialog's owner is " + this.Owner.Name); Method A - In the load of MDIChild I have the following code,

Twitter BootStrap Modal Window fallback link

旧巷老猫 提交于 2019-12-03 11:59:58
I am using Twitter Bootstrap modal windows. Just incase the modal windows dont work because of the js error - have a fall back pages. How can i make sure the page is loaded if the modal window doesnt load ? Link to open Modal Window <a href="#login-modal" data-toggle="modal" data-target="#login-modal">Login</a> Modal Window <!-- Login Modal --> <div id="login-modal" class="modal hide fade landing-modal" tabindex="-2" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true"> × </button