MVC Jquery Dialog: modal:true prevents the dialog from rendering - asp.net-mvc

I am using MVC2 on VS2010 Express edition.
I Have a (simplified) page that includes RenderPartial for a dialog. The dialog is supposed to pop up when a button is clicked. However, if I include modal:true as one of the dialog options, then when the button is clicked nothing happens. The dialog does not pop up. When I remove modal:true from the dialog options then dialog pops up as expected and closed as expected. Please help. I have sent so much time researching this problem and can't find anything. When at first I had a list several options specified for this dialog and it was not poping up, I removed them one by one to find out if any of them are causing the problem, and sure enough when I removed modal the dialog was rendered on clicking the button. Adding back the option modal: true stopped rendering of the dialog again.
These are in master page:
<link href="<%=ResolveUrl("~")%>App_Themes/smoothness/jquery-ui-1.8.2.custom.css" rel="stylesheet" type="text/css" />
<%=Html.Script("~/Scripts/jquery-1.4.2.min.js")%>
<%=Html.Script("~/Scripts/jquery-ui-1.8.2.custom.min.js")%>
<%=Html.Script("~/Scripts/jquery.form.js")%>
This is the page that is initially rendered. The first line in bold is the line for the button that when clicked, it would open the dialog. The second line in bold the line that is supposed to actually render the dialog:
Request Dialog
My Menu
<% Html.RenderPartial("get_dlg", ViewData.Model.FName); %>
This is the entire code for the dialog page (get_dlg). As such, the dialog does not show up when the button is clicked. Removing the line in bold will some reason allow the dialog to be rendered!
<script type="text/javascript">
$(document).ready(function () {
$("#get_dlg").dialog({
title: 'Get Dialog',
autoOpen: false,
modal: true
});
$('#requestDialog').click(function () {
$('#get_dlg').dialog("open");
})
});
</script>
show me something!
Any suggestions please?

I got help from someone on ASP.NET Forum: it is a CSS problem. adding the following to the ascx (view) fixed the problem:
<style type="text/css">
.ui-widget-overlay {
background-color: #000000;
left: 0;
opacity: 0.5;
position: absolute;
top: 0;
}
.ui-dialog {
background-color: #FFFFFF;
border: 1px solid #505050;
position: absolute;
overflow: hidden;
}
</style>

Related

Page goes black on opening jquery mobile panel

I am making a hybrid app, in which I have a left panel. On opening the left panel my page turns black. I am facing this problem only in windows phone 8. Panels work properly on android devices. Is there a problem with Windows support for jQuery Mobile?
I have an image for the menu button. onclick event of this image i have called a javascript function. the javascript function is as follows
<img src="images/leftnav_icon.png" id="leftnavImage" onclick="OpenLeftPanel()"/>
function OpenLeftPanel() {
$('#myPanel ul').listview();
$('#myPanel ul').listview('refresh');
$("#myPanel").panel("open");
}
How about just opening the panel th default way like described in the docs
<a href="#[your_panel_id]" data-rel="panel">
<img src="..." />
</a>
The data-rel should be optional. To run your listview-foo, bind to panelbeforeopen and run your stuff then (described on the same link as above).
Thank you all for your help. I got this problem solved. I just added a footer to all my pages and the left panel works fine now! CSS for footer is
#yourFooterId{
position: absolute;
bottom: 0px;
width: 100%;
height: 1px;
opacity: 0;
}

AjaxFileUpload control's Drop zone not visible on IE10

I have Ajax file upload control on an aspx page. The drag and drop zone of the control is visible on Chrome and mozilla but not on IE10. I understand that it should be visible on browsers which support HTML5 and CSS3. I believe IE10 has the support.
I went through the CSS and found this difference
<div class="ajax__fileupload_dropzone" id="ctl00_Mainform_AjaxFileUpload_Html5DropZone" style="width: 100%; height: 60px; visibility: visible;">Drop files here</div> (In Chrome)
<div class="ajax__fileupload_dropzone" id="ctl00_Mainform_AjaxFileUpload_Html5DropZone" style="width: 100%; height: 60px; display: none; visibility: hidden;"/> (In IE10)
In case of IE10, The display is set to none and visibility to hidden.
My question specifically is
At what point is this browser specific css rendered? so that I could get to why this is happening even when there is support for HTML5 and CSS3
I believe I cannot change this property in my code as it would be overwritten again in case of IE10.
EDIT:
I did try to edit the css by setting display to "block" and visibility to "visible". But this creates a disproportionate view with scroll bars which is not an ideal solution in my case
catch it with jquery.
// let the dropzone load first
setTimeout(function () {
$('.ajax__fileupload_dropzone').text('Drag Drop/Click');
if ($.browser.msie) {
$('.ajax__fileupload_dropzone').css({'visibility': 'visible','display':''});
}
}, 10);
this got it to show but it would not work right. I updated the toolkit from 15.1.2.0 to 15.1.3.0 and this seems to fix the problem. The odd thing is the night before I had no problems with IE.

JQuery UI 1.10.2 - How to get resize handles visible inside dialog?

The resize handles don't show on dialog or in anything I try to resizablify inside a dialog. I know this is by design that they are disabled in the themes, but how do I get them visible? I need to see them in the dialog content and the ones for the dialog would not hurt either.
<p>Dialog
<div id="dialog" style="display:none;">
<p>foobar</p>
<div style="width:100px; height:100px; border:1px solid;" id="bar">BAR</div>
</div>
<script>
$(function(){
$('a[href=#dialog]').click( function(e) {
e.preventDefault();
$('#dialog').dialog({
open: function() {
$('#bar').resizable({handles:'sw,se,e'});
}
});
});
});
</script>
Also in JSFiddle: http://jsfiddle.net/s22nx/
There are a couple of things going on here contributing to the problem, one of them could be a bug.
Firstly, you are correct that the south-east handle was hidden intentionally, however all 8 handles still exist as elements in the dialog. This is good news since you can add the following CSS to bring the se handle back. It's a bit of a hack to get around the intentional hiding and you might want to adjust the right and bottom positioning to suit your needs.
.ui-dialog .ui-resizable-se {
right:0 !important;
bottom:0 !important;
background-position: -64px -224px !important;
}
The other grabbers seem to by design have no style associated with them. None of the themes I checked have any visible style (aside from the cursor). Search for .ui-resizable- in the jquery-ui.css to see this.
This is sort of covered in the documentation but only mentioned in the context of generating your own handles. There is nothing explicit about existing theme support. Luckily all the handles share a class, so we can make them all visible by adding:
.ui-resizable-handle {
background-color:lightblue;
}
Or just one side, for example:
.ui-resizable-s {
background-color:lightblue;
}
The possible bug I mentioned was to do with controlling the generation of handle elements. The code in question $('#bar').resizable({handles:'sw,se,e'}); should be correct and result in only 3 handle elements but all 8 always appear.
In the _makeResizable function in jquery-ui.js (v1.10.2) the line:
resizeHandles = typeof handles === "string" ? handles : "n,e,s,w,se,sw,ne,nw";
should set the correct resizeHandles to the value you supply as an options parameter but typeof handles = 'object' for me, so jQueryUI is using the else part of the ternary.
In the css file, I had to change:
.ui-dialog .ui-resizable-se {
width: 12px;
height: 12px;
right: -5px;
bottom: -5px;
background-position: 16px 16px;
}
to:
.ui-dialog .ui-resizable-se {
width: 12px;
height: 12px;
right: 3px;
bottom: 3px;
}
Or you just forget to include required css
<script src="js/jquery-ui.min.js"></script>
Check this
UPD
They do get handles, they're just not visible with the default theme. This isn't something specific to jQuery UI. Many resizable windows work this way.

highslide close button doesn't work in ie

Hi I have a problem and I can't find solution
If you know / used highslide script you know it's amazing, but as always f***g IE has to make life more difficult.
Launch IE9 and go to page http://highslide.com/examples/youtube.html
Then try to open and close video, you will see that it won't close (ESC button works properly). You have to do it more than once. The problem appears only in IE9
Any ideas?
Thanks a lot and sorry for my english :)
This is a known issue in IE9; the flash player throws an error, and unfortunately this JavaScript error somehow affects the Highslide close button the second time we tries to close the popup. Our developer has not been able to find why this error affects the Highslide close button.
You can however still close the popup with the ESC key.
A workaround for IE 9 is to add a message in the caption telling IE 9 users to use the ESC key to close the popup. Demo page: http://roadrash.no/hs-support/youtube-with-alternative-close-method-for-ie9.htmlAdd this code after the regular Highslide settings:
<!--[if IE 9]>
<script style="text/javascript">
hs.captionText = 'Click the ESC key to close';
</script>
<style type="text/css">
.draggable-header .highslide-header ul {
display: none;
}
.highslide-caption {
font-style: italic;
font-size: 11px !important;
text-align: center;
}
</style>
<![endif]-->

how to remove default close button in dialog page in jquery mobile 1.0?

how to remove default close button in dialog page in jquery mobile 1.0.
i'm using RC2 version.
thanks in advance.
Please put this in your page or stylesheet:
<style>
.ui-dialog .ui-header .ui-btn-icon-notext { display:none;}
</style>
<style>
.ui-dialog .ui-header .ui-btn-icon-notext { display:none;}
</style>
this doesn't work. at least with jquery.mobile-1.2.0
.ui-dialog .ui-header a[data-icon=delete] {
display: none;
}
but this way works
Now I'm using jQueryMobile 1.0.1. In this version no need to add this line in CSS file.
<style>
.ui-dialog .ui-header .ui-btn-icon-notext { display:none;}
</style>
If you have the situation that you want the close button refer to an arbitrary (not the last) page, you could also change the page to your desired close page first. Afterwards open the dialog like this:
// change to the "close" page first
$.mobile.changePage('#your_page_id_here');
now you can open the dialog and the close button will open #your_page_id_here
// for some reason you have to wrap it in a timeout
window.setTimeout(
function( data){
$.mobile.changePage('#dialog');
},
1
);
Advantages:
solution works for single dialogs rather than removing all close buttons from all dialogs
seamless integration on a single point of code
history manipulation is not recommended, see here

Resources