jquery-ui-dialog

jQuery: Set modal dialog overlay color

橙三吉。 提交于 2019-11-29 01:05:21
I would like to pop a modal dialog using jquery ui where the overlay is completely black. I know that I can set this in the theme, but I do not want all dialogs to have a black overlay. Just one of them. Is there a way to configure a dialog's background (overlay) color on a per-dialog basis? Perhaps when it is created? TIA mohitp You can use the open and close events of the ui-dialog. $("#your-dialog").dialog( { autoOpen: false, modal: true, open: function() { $('.ui-widget-overlay').addClass('custom-overlay'); } }); And add the required styling in the CSS. Example: .ui-widget-overlay.custom

jQuery modal dialog with postbacks in ASP.NET

为君一笑 提交于 2019-11-28 19:06:06
问题 I just upgraded my jQuery/jQuery UI to the latest version (jQuery 1.9.0, jQuery UI 1.10.0), and it seems to have broken some of my jQuery UI dialog functionality. In order to do postbacks in a jQuery UI dialog in ASP.NET, there was a pretty common workaround where you would have to re-append your DIV to the main FORM, since jQuery would re-construct the DIV outside the FORM, like so: $("#newInsurance").dialog({ autoOpen: false, modal: true, open: function (type, data) { $(this).parent()

jQuery UI Alert Dialog as a replacement for alert()

做~自己de王妃 提交于 2019-11-28 18:44:12
I'm using alert() to output my validation errors back to the user as my design does not make provision for anything else, but I would rather use jQuery UI dialog as the alert dialog box for my message. Since errors are not contained in a (html) div, I am not sure how to go about doing this. Normally you would assign the dialog() to a div say $("#divName").dialog() but I more need a js function something like alert_dialog("Custom message here") or something similiar. Any ideas? Clive I don't think you even need to attach it to the DOM, this seems to work for me: $("<div>Test message</div>")

jquery dialog save cancel button styling

别来无恙 提交于 2019-11-28 17:11:12
I am using jquery ui dialogs in my application. How do I style the "Save" and "Cancel" buttons differently in a jquery dialog? So "Save" is more appealing than the "Cancel". I could use a hyper link for "Cancel", but how do I place that in the same button panel? Andriy Tkach Here is how to add custom classes in jQuery UI Dialog (Version 1.8+): $('#foo').dialog({ 'buttons' : { 'cancel' : { priority: 'secondary', class: 'foo bar baz', click: function() { ... }, }, } }); Alex Torrance In jQueryUI 1.8.9 using className rather than classes works. $('#element').dialog({ buttons:{ "send":{ text:'Send

jQuery UI dialog button text as a variable

邮差的信 提交于 2019-11-28 17:09:49
Can anyone tell me how can i use a variable for button text in jQuery UI dialog? I want to make a dynamic button name. W. van Kuipers This won't work because of the way jQuery handles the button name (can be with or without quotes) This will work: var button_name = 'Test'; var dialog_buttons = {}; dialog_buttons[button_name] = function(){ closeInstanceForm(Function); } dialog_buttons['Cancel'] = function(){ $(this).dialog('close'); } $('#instanceDialog').dialog({ buttons: dialog_buttons }); What you can do is assign the button in the dialog an ID and then manipulate it using standard jQuery. $

What is the best practice for opening a jquery dialog from angular?

谁都会走 提交于 2019-11-28 16:48:33
问题 Heres the html: <div ng-controller="MyCtrl"> <a ng-click="open()">Open Dialog</a> <div id="modal-to-open" title="My Title" ui-jq="dialog" ui-options="{width: 350, autoOpen: false, modal: true}"> Dialog Text </div> </div> And here's the js: function MyCtrl($scope) { $scope.open = function () { $('#modal-to-open').dialog('open'); } } Is this the best way to go about doing this? It seems like there could be a better way of opening it without accessing the DOM but I am not sure how I would go

jQuery UI: How to use ui-widget-overlay by itself?

血红的双手。 提交于 2019-11-28 16:44:50
I am trying to create an overlay, similar to the one that jQuery UI Dialog uses. I can create the overlay like this: var $overlay = $('<div class="ui-widget-overlay"></div>').hide().appendTo('body'); //...later in my script $overlay.fadeIn(); But the overlay cuts off when I scroll down. I noticed that jQuery UI is setting the width and height on that div dynamically. So I would like to reuse this functionality instead of reinventing the wheel. How can I create an overlay like this, or reuse the one in jQuery UI? Solution: Set the width/height of the overlay to be the width/height of the

jQuery UI Slider - max value (not end of slider)

混江龙づ霸主 提交于 2019-11-28 13:10:35
I have a stepped slider, with non-linear steps - code: $(function() { var trueValues = [5, 10, 20, 50, 100, 150]; var values = [10, 20, 30, 40, 60, 100]; var slider = $("#parkSlider").slider({ orientation: 'horizontal', range: "min", value: 40, slide: function(event, ui) { var includeLeft = event.keyCode != $.ui.keyCode.RIGHT; var includeRight = event.keyCode != $.ui.keyCode.LEFT; var value = findNearest(includeLeft, includeRight, ui.value); slider.slider('value', value); $("#amount").val(getRealValue(value)); return false; }, }); function findNearest(includeLeft, includeRight, value) { var

Jquery UI dialog not working along side JQuery Mobile

早过忘川 提交于 2019-11-28 12:38:35
问题 I cannot get a simple dialog box working in JQuery when I also include JQuery mobile: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>jQuery UI Dialog - Default functionality</title> <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"> <script src="https://code.jquery.com/jquery-2.1.4.js"></script> <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>

jQuery, MVC3: Submitting a partial view form within a modal dialog

徘徊边缘 提交于 2019-11-28 11:21:51
I'm just playing around with jQuery and MVC3 at the moment, and am wondering how I can submit a form, which has been dynamically loaded into a jQueryUI dialog? My code so far consists of... Javascript/jQuery $(document).ready(function () { $('.trigger').live('click', function (event) { var id = $(this).attr('rel'); var dialogBox = $("<div>"); $(dialogBox).dialog({ autoOpen: false, resizable: false, title: 'Edit', modal: true, show: "blind", hide: "blind", open: function (event, ui) { $(this).load("PartialEdit/" + id.toString()); } } }); $(dialogBox).dialog('open'); }) }); cshtml <h2>Detail</h2