jquery-ui-dialog

How to tell if any jquery dialog happens to be open? [duplicate]

扶醉桌前 提交于 2019-12-03 15:17:35
问题 This question already has answers here : Detect if a jQuery UI dialog box is open (5 answers) Closed 3 years ago . Looking for a general case solution to determine if any jquery dialog (there are multiple) is currently open. Have tried: $(".ui-dialog-content").dialog("isOpen") === true $(".ui-dialog").dialog("isOpen") == true $(document).dialog("isOpen") == true $("*").dialog('isOpen') == true without any success. I expected ".ui-dialog-content" to work, since I can apparently close any open

jquery ui dialog box as confirm

自古美人都是妖i 提交于 2019-12-03 15:13:56
I am, trying to replicate the 'confirm' box of javascript using jquery dialog. This is my code, function customConfirm(customMessage) { $("#popUp").html(customMessage); $("#popUp").dialog({ resizable: false, height: 240, modal: true, buttons: { "OK": function () { $(this).dialog("close"); alert(true); return true; }, Cancel: function () { $(this).dialog("close"); alert(false); return false; } } }); } But when I tried to alert this method, it shows 'undefined'. It is not waiting for the popup to display. How can i make this customConfirm function to wait for the users input(ok/cancel)?. My need

with jquery UI dialog, is there anyway to have a max height and use 'auto' if its smaller

痞子三分冷 提交于 2019-12-03 14:53:12
问题 I want a dialog to have a max height setting but, if the content is smaller, then to shrink down to do what height = 'auto' does. Is this possible in JQuery UI dialog? 回答1: You can achieve this by doing the following: HTML <div id="dialog" title="Dialog Title"> Dialog content </div> JavaScript $('#dialog').dialog({ resizable: false, minHeight: 0, create: function() { $(this).css("maxHeight", 400); } }); Check out test case on jsFiddle. 回答2: I use this: $('#dialog').dialog({ maxHeight: $

iFrame in jQuery UI dialog causes horizontal scrollbar on parent

半腔热情 提交于 2019-12-03 14:15:06
问题 I'm using the jQuery UI dialog to present content in a new iFrame. Everything works out great except that the parent window of the dialog is getting a horizontal scrollbar while the dialog is displayed (IE8). I've tracked down the problem to the <html> element within the iFrame being interpreted as very wide by the browser, even though the only content on the page in the iFrame in a 580px div. I've tried adding CSS to the HTML and BODY tags within the iFrame (e.g. width: 98% or width: 600px;)

How to set jQuery UI dialog defaults

扶醉桌前 提交于 2019-12-03 13:12:24
How do I set the default values for the jQuery UI dialog? For example, this is how I set the defaults in the jQuery UI datepicker: $.datepicker.setDefaults({ dateFormat: 'dd/mm/yy' }); I couldn't find the same functionality in the dialog documentation I found a solution $.extend($.ui.dialog.prototype.options, { modal: true, width: 650 }); Groovetrain There's no built-in functionality for that AFAIK, but what I usually do is set them myself in a separate hash like this: var dialog_defaults = { autoopen: false, buttons: { close: function() { $(this).dialog('close'); } } }; Then when I create the

jQuery UI Dialog + Validate

怎甘沉沦 提交于 2019-12-03 12:51:33
I'm having trouble in validating a jQuery UI dialog using Jquery Validate upon clicking Save. Here's my code to create Jquery dialog. It loads the dialog from a target a href URL: $(document).ready(dialogForms); function dialogForms() { $('a.dialog-form').click(function() { var a = $(this); $.get(a.attr('href'),function(resp){ var dialog = $('<div>').attr('id','formDialog').html($(resp).find('form:first').parent('div').html()); $('body').append(dialog); dialog.find(':submit').hide(); dialog.find('#return').hide(); dialog.dialog({ title: a.attr('title') ? a.attr('title') : '', modal: true,

Replacing the Close icon for a JQueryUI Dialog box

岁酱吖の 提交于 2019-12-03 12:30:37
After extensive searching on this topic, I haven't been able to find an answer, so hopefully someone can help me with this issue. I have a relatively basic dialog box: $("#dialog-search").dialog({ resizable: false, height:dimensionData.height, width: dimensionData.width, modal: true, title: dimensionData.title, position: [x,y], open: function() { $("#dialog-search .dateField").blur(); }, close: function(event, ui){ callBack(event,ui); } }); What I want to do is replace the X icon (ui-icon-close) with a different icon provided by the ui (ui-icon-minus), so that clicking the minus icon closes

jQuery UI - Error: cannot call methods on dialog prior to initialization; attempted to call method 'open' [duplicate]

杀马特。学长 韩版系。学妹 提交于 2019-12-03 12:21:42
问题 This question already has answers here : jquery ui Dialog: cannot call methods on dialog prior to initialization (11 answers) Closed 3 years ago . [Solved] I write this script. Unfortunately, jQuery console throw: Error: cannot call methods on dialog prior to initialization; attempted to call method 'open' I use jQuery 1.10.2 and jQuery UI 1.10.4. $(function() { $("#player").on('click', 'img', function() { var zadanie = $( "input[name^='act']:checked:enabled" ).val(); switch(zadanie){ case '1

jQuery UI modal dialog captures all keypress so I can't input text inside it

蓝咒 提交于 2019-12-03 09:49:20
I create modal dialog with form inside it (with some text input). And I just can't enter the text inside the textbox. Dialog blocks keyboard input. Here is my simplified example: <div id="modal-dialog"> <label for="my-text">TRY to input text...</label> <textarea id="my-text" style="position:relative; z-index:1"></textarea> </div> <script type="text/javascript"> var dialog = $('#modal-dialog').dialog({ modal: true }); </script> Note : You may ask - why did I mentioned about "position:relative; z-index:1" ? Because it works fine without it. But I can't remove it because of design. Note : not

Using jquery-ui dialog as a confirm dialog with an ASP:LinkButton (how to invoke the postbck)

℡╲_俬逩灬. 提交于 2019-12-03 09:03:38
I'd like to use jQuery UI's dialog to implement a confirm dialog which is shown when the user clicks a delete-link (implemented using an asp:LinkButton ). I'm using code as shown below (copied from the jquery ui documentation): <!-- the delete link --> <asp:LinkButton ID="btnDelete" runat="server" Text="Delete" OnClick="btnDelete_Click" CssClass="btnDelete"></asp:LinkButton> <!-- the confirm-dialog --> <div id="dialog-confirm-delete" title="Delete?" style="display:none;"> <p>Are you sure you want to permanently deleted the selected items?</p> </div> <script> $(document).ready(function () { //