jquery-ui-dialog

jquery ui Dialog: cannot call methods on dialog prior to initialization

*爱你&永不变心* 提交于 2019-11-26 19:51:47
I have an app on jquery 1.5 with dialogs worked fine. While I have a lot of .live handlers, I changed this to .on. For that, I have to update jquery (now 1.8.3 an jquerui 1.9.1). Now, I got: Error: cannot call methods on dialog prior to initialization; attempted to call method 'close' Following is the code: Javascript var opt = { autoOpen: false, modal: true, width: 550, height:650, title: 'Details' }; $(document).ready(function() { $("#divDialog").dialog(opt); $("#divDialog").dialog("open"); ... html code <div id="divDialog"> <div id="divInDialog"></div> </div> Any idea why this might be

Make JQuery UI Dialog automatically grow or shrink to fit its contents

假装没事ソ 提交于 2019-11-26 18:54:43
问题 I have a JQuery UI dialog popup that displays a form. By selecting certain options on the form new options will appear in the form causing it to grow taller. This can lead to a scenario where the main page has a scrollbar and the JQuery UI dialog has a scrollbar. This two-scrollbar scenario is unsightly and confusing for the user. How can I make the JQuery UI dialog grow (and possibly shrink) to always fit its contents without showing a scrollbar? I would prefer that only a scrollbar on the

jQuery UI Dialog OnBeforeUnload

丶灬走出姿态 提交于 2019-11-26 17:27:49
I have a small problem. I'm attempting to catch the OnUnLoad Event of the Window and ask a confirmation question and if the user decides they want to stay then fine, and if they want to leave the page then they'll lose all unsaved data. Here's the issues... I'm using a jQuery UI Dialog and when I put the following code on my page, I have the Dialog open, and when I click the back button on the browser, it never pops up the msgbox. It just refreshes the page: <script type="text/javascript"> $(window).bind('beforeunload', function() { alert('you are an idiot!'); } ); </script> And the solution

jquery-ui-dialog - How to hook into dialog close event

爱⌒轻易说出口 提交于 2019-11-26 16:00:54
I am using the jquery-ui-dialog plugin I am looking for way to refresh the page when in some circumstances when the dialog is closed. Is there a way to capture a close event from the dialog? I know I can run code when the close button is clicked but that doesn't cover the user closing with escape or the x in the top right corner. Brownie I have found it! You can catch the close event using the following code: $('div#popup_content').on('dialogclose', function(event) { alert('closed'); }); Obviously I can replace the alert with whatever I need to do. Edit: As of Jquery 1.7, the bind() has become

Passing data to a jQuery UI Dialog

 ̄綄美尐妖づ 提交于 2019-11-26 14:04:32
I'm developing an ASP.Net MVC site and on it I list some bookings from a database query in a table with an ActionLink to cancel the booking on a specific row with a certain BookingId like this: My bookings <table cellspacing="3"> <thead> <tr style="font-weight: bold;"> <td>Date</td> <td>Time</td> <td>Seats</td> <td></td> <td></td> </tr> </thead> <tr> <td style="width: 120px;">2008-12-27</td> <td style="width: 120px;">13:00 - 14:00</td> <td style="width: 100px;">2</td> <td style="width: 60px;"><a href="/Booking.aspx/Cancel/15">cancel</a></td> <td style="width: 80px;"><a href="/Booking.aspx

How to have jQueryUI dialog box dynamically load content

空扰寡人 提交于 2019-11-26 10:32:31
问题 I love jQueryUI\'s dialog boxes. However, there doesn\'t seem to be a way to dynamically load content built-in. I guess I have to use some other approach to achieve this? Will iframes load content only when they\'re made visible? Is that the right way to do this? I\'m open to other dialog box mechanisms if they\'re more suited for loading the content only when they\'re first opened. 回答1: This isn't hard to do -- I wouldn't start messing with iframes for this alone. How about something like

How to close jQuery Dialog within the dialog?

三世轮回 提交于 2019-11-26 10:27:29
问题 How to close jQuery Dialog within the dialog without using the close button? Inside the ui dialog is a simply form request and if a successful submission occurs, then the ui dialog automatically closes and refreshes the parent page. <script type=\"text/javascript\"> $(document).ready(function () { $(\"#form-dialog\").dialog({ autoOpen: true, modal: true, width: 200, draggable: true, resizable: true }); }); </script> <div id=\"form-dialog\" title=\"Form Submit\"> <form action=\"default.aspx\"

Correctly calling setGridWidth on a jqGrid inside a jQueryUI Dialog

天涯浪子 提交于 2019-11-26 09:43:30
问题 I have a jQueryUI dialog ( #locDialog ) which has a jqGrid ( $grid ) inside it. When the Dialog opens (initially, but it gets called whenever it opens), I want the $grid to resize to the size of the $locDialog . When I do this initially, I get scrollbars inside the grid (not inside the dialog). If I debug the code, I see the width of the $grid is 677. So, I call setGridWidth() again and check the width and now I have 659, which is 18px less, which is the size of the scroll area for the jqGrid

jQuery UI Dialog Button Icons

爱⌒轻易说出口 提交于 2019-11-26 09:28:28
问题 Is it possible to add icons to the buttons on a jQuery UI Dialog? I\'ve tried doing it this way: $(\"#DeleteDialog\").dialog({ resizable: false, height:150, modal: true, buttons: { \'Delete\': function() { /* Do stuff */ $(this).dialog(\'close\'); }, Cancel: function() { $(this).dialog(\'close\'); } }, open: function() { $(\'.ui-dialog-buttonpane\').find(\'button:contains(\"Cancel\")\').addClass(\'ui-icon-cancel\'); $(\'.ui-dialog-buttonpane\').find(\'button:contains(\"Delete\")\').addClass(\

jQuery UI Dialog Box - does not open after being closed

心已入冬 提交于 2019-11-26 09:18:05
问题 I have a problem with the jquery-ui dialog box. The problem is that when I close the dialog box and then I click on the link that triggers it, it does not pop-up again unless I refresh the page. How can I call the dialog box back without refreshing the actual page. Below is my code: $(document).ready(function() { $(\'#showTerms\').click(function() { $(\'#terms\').css(\'display\',\'inline\'); $(\'#terms\').dialog({ resizable: false, modal: true, width: 400, height: 450, overlay: {