jquery-ui-dialog

Detect if a jQuery UI dialog box is open

ⅰ亾dé卋堺 提交于 2019-11-30 11:10:53
问题 I am using a jQuery UI dialog. If it is open, I want to do one thing. If it is closed, I want to do another. My question is, how do I detect if a jQuery UI dialog box is open or not? 回答1: If you read the docs. $('#mydialog').dialog('isOpen') This method returns a Boolean (true or false), not a jQuery object. 回答2: Actually, you have to explicitly compare it to true. If the dialog doesn't exist yet, it will not return false (as you would expect), it will return a DOM object. if ($('#mydialog')

jquery UI autocomplete inside a modal ui dialog - suggestions not showing?

我与影子孤独终老i 提交于 2019-11-30 10:58:27
i am using the jquery ui autocomplete widget inside the jquery ui dialog. when i type in the search text, the textbox indents (ui-autocomplet-loading) but does not show any suggestions. var availableTags = ["c++", "java", "php", "coldfusion", "javascript", "asp", "ruby", "python", "c", "scala", "groovy", "haskell", "perl"]; $("#company").autocomplete({ source : availableTags , minLength: 2 }); company is the id of the textbox to attach the autocomplete. i thought it might be a z index so i set this: .ui-autocomplete, .ui-menu, .ui-menu-item { z-index: 1006; } but it still does not show. i put

Animate jQuery UI dialog auto resize

一个人想着一个人 提交于 2019-11-30 09:50:41
I have a dialog with a dynamic form inside that can increase the height of the dialog. autoResize is set to true, width is 500. Is there any way to animate the dialog resize when more content is added? Animating dialog size, while staying in the center of the screen jQuery("#dialog").dialog("widget").animate({ width: '400px', height: '110px' }, { duration: 500, step: function() { jQuery("#dialog").dialog('option', 'position', 'center'); } }); Originally I was using .show('fade') and the size of the dialog would jump whenever .show was called. When using the effect .show('fast') or .show('slow'

jQuery - remove user input text from textarea

帅比萌擦擦* 提交于 2019-11-30 06:37:37
Okay I have a list of devices where i can select which to edit. I have 3 states for the edit. When no devices are selected, when 1 device is selected or when x devices are selected. The problem i have is when a user type some text in the textarea (commentField) and cancels the edit to edit another device, the text there was typed in the textarea won't disapere. It stays so when i get the new dialog for the new edit, the commentfield has the text from the old commentField (as if it wasn't cleared) I have tried the following codes to remove the text (both when then cancel button is pressed and

jQuery UI dialog: vertical scroll works not correct if dialog height more than window height

旧城冷巷雨未停 提交于 2019-11-30 05:47:45
问题 Here is code: <script type="text/javascript"> $(function(){ var dialogOptions = { title: "Header", autoOpen: false, modal: true, width: 400, height: 1000 }; $(".wnd").dialog(dialogOptions); $("#btn").click(function(){ $(".wnd").dialog("open"); }); }); </script> <style> .wnd {background:yellow;height:900px;width:300px;} </style> <div class="wnd"></div> <button id="btn">click me</button> When dialog is opened and it higher than main window there is a side slider and it doesn't slide down if you

In jquery UI dialog, is it possible to put a modal dialog on top of another modal dialog

﹥>﹥吖頭↗ 提交于 2019-11-30 04:59:26
I have a modal dialog using jquery UI dialog. I now want to popup another dialog when i user changes a field in the first dialog. Both should be modal. Is this possible as i tried putting this code there and nothing seems to popup. The following code works fine when click from a regular page (where the select control with id: selectDropdownThatICanChange) but if the same select control that i am changing is itself a dialog the dialog("Open") line does nothing. The change event fires and the open method gets called but nothing pops up. $("#secondModalDialog").dialog({ resizable: false, height:

jQuery Ui Dialog Buttons, How to add class?

给你一囗甜甜゛ 提交于 2019-11-30 04:11:05
I found this answer on another thread.. How to add multiple buttons in Jquery UI dialog box? Using this syntax, how do you add class to a particular button? $("#mydialog").dialog({ buttons: { 'Confirm': function() { //do something $(this).dialog('close'); }, 'Cancel': function() { $(this).dialog('close'); } } }); Andrew Whitaker It doesn't look like there's a great way to do this via the API, however you could add the classes in an event handler for create : $("#dialog").dialog({ buttons: { 'Confirm': function() { //do something $(this).dialog('close'); }, 'Cancel': function() { $(this).dialog

jQuery UI dialog - check if exists by instance method

孤者浪人 提交于 2019-11-30 04:10:06
I'd like to use instance method for testing if jQuery UI Dialog widget has been initialized or not. Regarding to API , this is possible, but it doesn't work for me: Uncaught Error: cannot call methods on dialog prior to initialization; attempted to call method 'instance' demo: http://jsfiddle.net/mDbV7/ UPDATE: This was a mistake in the documentation, instance method will be available from version 1.11.0, see this issue . jbabey The latest version of jQuery UI no longer allows you to call UI methods on items that are not initialized yet. I've just been wrapping them in an if statement, like:

jquery ui dialog fixed positioning

て烟熏妆下的殇ゞ 提交于 2019-11-30 01:19:14
I needed the dialog to maintain its position fixed even if the page scrolled, so i used the extension at http://forum.jquery.com/topic/dialog-position-fixed-12-1-2010 but there's 2 problems with it: it flickers in IE and Firefox on page scroll (in Safari/Chrome it's fine) on closing and then reopening, it looses its stickyness and scrolls along with the page. Here's the code i'm using for creating the dialog: $('<div id="'+divpm_id+'"><div id="inner_'+divpm_id+'"></div><textarea class="msgTxt" id="txt'+divpm_id+'" rows="2"></textarea></div>') .dialog({ autoOpen: true, title: user_str, height:

jQueryUI Dialog + Firefox + ASP.Net = access to strict mode caller function is censored

余生长醉 提交于 2019-11-30 00:45:18
问题 I have a page that works great in IE and Chrome, but doesn't work in Firefox and Opera. When I say it doesn't work I mean that the Submit button doesn't do anything at all. It is a page with several nested UpdatePanels on it and a couple of jQueryUI Accordions on it too. I have a simple div . <div id="date-dialog" title="Date?"> <label id="lblDate" for="txtDate"> Please Enter Your The Date: </label> <input type="text" id="txtDate" class="text ui-widget-content ui-corner-all" /> </div> And