jquery-ui-dialog

Return value of jquery UI dialog Box

百般思念 提交于 2019-12-05 01:36:17
问题 You may find solution over this in many posts(Post 1 , Post2 ), but their solution not working for me. Here is the normal jquery dialog box written by me. $("#dialog").dialog({ autoOpen:false, buttons:{ "ok":function(){ $(this).dialog("close"); return true; }, "cancel":function(){ $(this).dialog("close"); return false; } } }); I will open the dialogbox with code: var returnVal=$("#dialog").dialog("open"); I need to return false ,if user clicks 'cancel' and return true if user clicks 'ok'. var

jquery ui dialog box as confirm

泄露秘密 提交于 2019-12-05 01:11:16
问题 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

How do I reload the page after an AJAX call is done with a dialog?

廉价感情. 提交于 2019-12-05 00:02:59
问题 so I have a dialog UI with a form once a user click on a link it opens. Once they click "Add button" it create a AJAX call that submits the data into the database. What I need to add is reload() function to refresh the page. How can I add the reload function? I have tried to add windows.localtion.reload(); you can see it my code. That line does not work for some reason //Update contact dialog box $( "#contact-edit" ).dialog({ resizable: false, width: 500, modal: true, autoOpen: false, buttons

Close all open dialog boxes? (JQuery)

狂风中的少年 提交于 2019-12-04 23:04:42
How can I close all opened dialog boxes in jQuery ? The situation is next: I have a simple page without dialogs. It has some buttons what open it owns dialogs. When I click on a button I need to close all opened dialogs. Here is the HTML: <div id="buttons"> <a href="#" id="btn_1">Button 1</a> <a href="#" id="btn_2">Button 2</a> <a href="#" id="btn_3">Button 3</a> </div> <div id="dialog_1" class="dialogbox">...</div> <div id="dialog_2" class="dialogbox">...</div> <div id="dialog_3" class="dialogbox">...</div> And here is the jQuery: $(function() { $('#buttons').find('a').click(function() { //

Window scrolling up when jquery dialog opens up

╄→尐↘猪︶ㄣ 提交于 2019-12-04 22:31:14
I am trying to open a modal jquery dialog using jquery 1.4 and jquery-ui-1.8rc3.custom.js The dialog opens up with no issues, in all browsers, but in IE 7 and 6, after the dialog opens up, the window scrolls itself to the buttom... I tried scrolling the window up back to the modal position but is very inconsistent. was using the following line of code after opening up the modal window.scrollTo($('#selector').dialog('option', 'position')[0],$('#selector').dialog('option', 'position')[1]); One weird thing I am noticing is that after I open the modal, the page becomes huge... as if some extra

JQueryUI Dialog Size

情到浓时终转凉″ 提交于 2019-12-04 22:18:36
I'm new to JQueryUI, and though I have a dialog working, it doesn't open at the size I think I'm specifying. Why does setting the width and height when the dialog is defined not affect the initial size of the dialog? How do I make it 600px by 500 px? Here is the div that defines the dialog: <div id="dialog-form" title="Create Appointment"> <form> . . . </form> </div> Here is the JavaScript that makes a dialog of it: $(function() { $("#dialog-form").dialog({ autoOpen: false, maxWidth:600, maxHeight: 500, width: 600, height: 500, modal: true, buttons: { "Create": function() { $(this).dialog(

Populating fields in modal form using PHP, jQuery

狂风中的少年 提交于 2019-12-04 21:39:11
I have a form that adds links to a database, deletes them, and -- soon -- allows the user to edit details. I am using jQuery and Ajax heavily on this project and would like to keep all control in the same page. In the past, to handle editing something like details about another website (link entry), I would have sent the user to another PHP page with form fields populated with PHP from a MySQL database table. How do I accomplish this using a jQuery UI modal form and calling the details individually for that particular entry? Here is what I have so far- <?php while ($linkDetails = mysql_fetch

jQuery UI overlay without dialog [duplicate]

陌路散爱 提交于 2019-12-04 18:01:59
Possible Duplicate: jQuery UI: How to use ui-widget-overlay by itself? I want to avoid the user to change the screen during ajax calls. So I was thinking to use jQuery UI overlay (the overlay of the modal dialogs) but without any dialog. I couldn't find any way to do this. Is there any way to show a modal without a dialog? Diego I take this answer of another SO question. Here there is a fiddle . And the code: $("body").append($.ui.dialog.overlay.create()) The dialog with the modal option set to true adds the following div, where width and height represent the viewable area in the browser

Replacing the Close icon for a JQueryUI Dialog box

天涯浪子 提交于 2019-12-04 17:45:20
问题 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

Extending widgets in Jquery UI with redefining parent methods

允我心安 提交于 2019-12-04 15:12:23
I try to extend UI dialog according to documentation (UI version 1.8.16): (function($) { $.widget('ui.mydialog', $.extend(true, $.ui.dialog.prototype, { _create: function() { return $.Widget.prototype._create.apply(this, arguments); } })); })(jQuery); $(function() { $('div#dialog').mydialog(); }); Executing of this code causes JS error: "this.uiDialog is undefined". And if try to override the _init() method there are no errors, but parent method call takes no effect. I'm confused.. Which way is legal to extending for e.g. put some custom initialize code? William Niu I think this post would