jquery-ui-dialog

How to change the 'X' button in a jquery dialog box to read 'Close'

风流意气都作罢 提交于 2019-12-05 14:09:14
I had a jquery dialog box in an MVC razor-view with a close button inside it. But on clicking the close button, the dialog just got hidden and not removed , so that when a click on any link on the page it doesnt work, which is not desired; noe do i want to redirect to my action method every time i close the dialog. On clicking the 'X' button on the dialog-header, i get exactly what i want. So my senior now wants me to completely remove the 'Close' button and write "close" instead of 'X' in the header. I managed to do it editing my dialogbox thru my chrome browser console, on removing a whole

Cannot set focus to a form field in a jQuery UI dialog on clicking a jQueryUI menu item

浪子不回头ぞ 提交于 2019-12-05 12:58:51
I've got a jQuery UI dialog containing a one-field form and the autoOpen property is set to false at the beginning. There's another jQuery UI menu on the page and the dialog's open function is binding to the click event of the menu items. I've been trying to set focus to the only form field of the dialog when the dialog is open on click of the menu items somehow no luck. To pinpoint the cause I also added another test button and by clicking that button I can set focus to the form field. So I'm pretty sure it's the jQuery UI menu that is preventing the focus of the field. I wonder if there's

jQuery ui dialog image for the title

*爱你&永不变心* 提交于 2019-12-05 12:06:45
Is it possible when specifying a jQuery UI dialog box, to have an image be placed for my title instead of just plain text? Thanks You can provide any HTML as the title option, like this: $("#dialog").dialog({ title: '<img src="myImage.jpg" />' });​​​​​​​​​​​ You can see an example in action here Or, as another demo to annoy the hell out of your users, you could do this : $("<div />").dialog({ title: '<marquee>Hello</marquee>' });​ 来源: https://stackoverflow.com/questions/3543532/jquery-ui-dialog-image-for-the-title

add custom method to jquery ui dialog

戏子无情 提交于 2019-12-05 11:53:54
How can I do something like: $("#some_div").dialog("doSomething"); And what that method should do is to add an extra icon in the titlebar EDIT 1 : I've tried this solution : the method gets called but I can't access the dialog object (maybe I'm doing something wrong) First, if you're adding an icon to the title bar I would suggest applying a class to that dialog box and styling it with CSS. Example: $( "#some_div" ).dialog({ dialogClass: "someClass" }); If you'd still like to add a custom method, here's what the documentation says: Supply a callback function to handle the create event as an

Setting max height of a dialog, then allow scrolling

拟墨画扇 提交于 2019-12-05 10:17:40
I can't seem to understand how to set the height correctly for the jquery ui dialog. I want it to display the height to however much content is present, but if it exceeds 400 pixels, then I want a scroll bar. So, if the content has 200 pixels in height, then the dialog should have a height of 200 pixels. If the content has a height larger than 400 pixels, then the dialog shouldn't expand past 400 pixels and a scroll bar should be visible. I have this so far: $("#popup").dialog({ modal: true, autoOpen: false }); $("#popup").dialog({ modal: true, autoOpen: false }); css #popup { border: 1px

server side validation in jquery dialog

孤人 提交于 2019-12-05 08:11:07
sorry for my language - in English i can only read :) i want to do in asp.net mvc something like this: 1. show user a page 2. open modal dialog (jquery-ui) and show partial view 3. validate user input data on client side 4. if it's OK then validate input data on server 5a. if it's OK then i want reload page 5b. if there is a errors i want show its to user 6. user can close dialog at any time with button on it. i have problem width 5a and 6. in Firefox when i do server validate and click close button (dialog('close')) when i get redirect to page that was call to validate data. if i click 'x' in

How can I tell if a jquery ui dialog query has been initialized?

我是研究僧i 提交于 2019-12-05 06:40:48
I have the following code to detect if a jquery ui dialog is open: if ($("#dialog-myDialog").dialog("isOpen")) { return; } which works fine but I found a situation where this code get called prior to the dialog being initialized in the first place and this if statement seems to just blow up in this case. What is the best way to check if a jquery ui dialog has been initialized so I can properly handle this situation. Test whether the element has the ui-dialog-content class: if ($("#dialog-myDialog").hasClass("ui-dialog-content") && $("#dialog-myDialog").dialog("isOpen")) { return; } If you use

How to localise buttons on JQueryUI modal dialog

懵懂的女人 提交于 2019-12-05 05:29:20
I have a JQueryUI modal dialog and everything is working fine except for one issue ... how do I localize the OK and Cancel buttons? I have gone through the demos and documentation and unless I am missing something very obvious, can't figure out how to do this ... My code: $("#MyDialog").dialog({ . . . buttons: { OK: function () { . . . }, Cancel: function () { . . . } } }); This displays a dialog with two buttons, "OK" and "Cancel". How do I get the buttons to read, for example, "Si" and "Cancellare" ..? What I need to do, is to be able to INJECT a localized value. So what I need is not to

Whitescreen issue in IE9 - Removing iframe

筅森魡賤 提交于 2019-12-05 05:28:20
I"m wondering if anyone can give me some insight into a really strange IE9 issue I've been struggling with. I'm finishing up production of a site for work - it works well in ff/chrome/ie7/ie8 with no script errors. On IE9 the last step of the application causes the entire tab to whitescreen with no script errors or warnings. (changing the document mode to ie8 will fix the problem but is obviously unsuitable for production) Unfortunately the site pretty complex with a ton of ajax, and in-page scripts so I can't really post the relevant code easily. I'm more trying to figure out how to diagnose

TinyMCE opened in jqueryUI modal dialog

白昼怎懂夜的黑 提交于 2019-12-05 04:25:25
When using tinyMCE in a jqueryUI modal dialog, I can't use the hyperlink or 'insert image' features. Basically, after lots of searching, I've found this: http://www.tinymce.com/develop/bugtracker_view.php?id=5917 The weird thing is that to me it seams less of a tinyMCE issue and more of a jqueryUI issue since the problem is not present when jqueryUI's modal property is set to false. With a richer form I saw that what happens is that whenever the tinyMCE loses focus, the first element in the form gets focus even if it's not the one focused / clicked. Does some JavaScript guru have any idea how