Problems with dropdown and jquery-ui dialog box - asp.net

I have a page with dropdown list and Dialog component from the jQuery UI library.
But the issue is dropdown list appears over dialog box in IE7 .In chrome,Mozilla Firefox it works fine.
Here is the code for jquery:-
var divdialog = $('#divdialog'); divdialog.dialog('destroy');
divdialog.dialog({
autoOpen: true,
height: 310,
width: 570,title: "Look Up",
modal: true,
open: function () {$('#testframe').attr("src", strValue);
$('#testframe').height($(this).height()-5); $('#testframe').width($(this).width()-10);
},
close: function (e) {
$('#divdialog').remove();
//divdialog.html('');
// divdialog.dialog('destroy');
},
resizable: true,
resize: function() { $('#divdialog iframe').hide(); },
resizeStop: function() { $('#divdialog iframe').show();
$('#divdialog iframe').height($(this).height()-10);
$('#divdialog iframe').width($(this).width()-10); } ,
closeOnEscape:true,
draggable:true
})
Here is the code for UI:-
<div id="divdialog" style="display:none;">
<iframe id="testframe" frameborder="0" title="dialogBox"><p>not supportted iframe</p></iframe>
</div>
<asp:DropDownList ID="ddlRoleNames" runat="server" Width="180px"
OnSelectedIndexChanged="ddlRoleNames_SelectedIndexChanged" AutoPostBack="true">
</asp:DropDownList>
Any ideas on this issue?

That might be because of the Z-index, why because even if your element is having the z-index as 1000, there will be a chance of having that element below the element with z-index as 1, if the both are not in the same stacking contexts.
So try giving the position as absolute in dropdown and let me know .
have a look at the below question also which may help
IE7 Z-Index Layering Issues
Hope this helps

Related

popover trigger not working for 'focus' but works for 'hover'

In my project, I use a bootstrap popover to show a table which populates through knockout observableArray. My problem is, it shows popover correctly to 'hover' but not to the 'focus'
This is my anchor link which triggers the popover.
<a style="cursor: pointer; font-weight: 100" data-bind="event: { mousedown: TndTrainingRegisterAdmin.ShowSchedule } , attr: { id: 'schedule' + appId()}" data-toggle="popover" data-trigger="focus" data-placement="right" data-html="true"> View Schedule </a>
I tried removing data-trigger="focus" and adding only one side of the code. it also didn't work out. So it's not due to code repetitions.
This is the knockout model's side code.
var ctrlId = '#schedule' + rs.appId();
$(ctrlId).popover(
{
template: '<div class="popover" role="tooltip" style="width: 100%; max-width:600px"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"><div class="data-content"></div></div></div>',
html: true,
content: function () {
return $('#divViewSchedule').html();
}
});
This is div code which contains the table.
<div id="divViewSchedule" class="hide">
#Html.Partial("~/Views/TrainingRegistration/_CourseSchedule.cshtml")
</div>
This popover works fine when I use data-trigger='hover' or trigger: 'hover' But I want it to work as 'focus' behavior. I tried adding data-trigger='focus' and trigger: 'focus' none of these working neither showing any errors in console.
Can Anyone help me, please? :)

Bootstrap multiselect dropdown causes screen flickering

I have added following script in my page :
1- MultiSelection.js
2- bootstrap.min.js
3- MultipleSelection.css
and I have specified my control like this:
<asp:ListBox ID="listBoxProductType" runat="server" SelectionMode="Multiple">
</asp:ListBox>
and javascript:
$(function () {
$('[id*=listBoxProductType]').multiselect({
includeSelectAllOption: true,
nonSelectedText: "P Type",
selectAllText: "Select All",
numberDisplayed: 1
});
});
This control is working as expected, but whenever I am reloading the page It is flickering for few seconds. I have come through solutions that suggest to make display none and I tried that too. But no luck. Can someone suggest me better ways to do this? Please see picture for more details.
try with display: none; visibility: hidden and opacity: 0; once select is render remove all CSS properties

SCROLL issue in Dojo Enhanced Grid-programmatically

I am facing issue with data displayed in Dojo enhanced grid. Grid containd two records(rows) but it is not displayed properly and also a horizontal scroll is coming which is scrollable beyond headers of the dojo grid.
I am creating a dojo enhanced grid programmatically as below:-
GRID Code:-
grid= new dojox.grid.EnhancedGrid({
id:"grid",
noDataMessage: noRecMsg,
escapeHTMLInData:false,
plugins: {
filter: {
closeFilterbarButton: false
},indirectSelection: true,
pagination: {
pageSizes: ["25", "50", "100", "All"],
description: true,
sizeSwitch: false,
pageStepper: true,
gotoButton: false,
/*page step to be displayed*/
maxPageStep: 3,
/*position of the pagination bar*/
position: "top"
}},
selectionMode: "single",
autoWidth: true,
rowSelector: '20px'},
document.createElement('div'));
dojo.byId("gridDiv").appendChild(grid.domNode);
grid.startup();
Store and Layout code as:-
gridLayout = [];
gridLayout.push({
'field': gridField,
'name': gridHeader,
'width': '120px'
});
grid.setStore(store);
grid.setStructure(gridLayout);
HTML Code:-
<div id="Det" data-dojo-type="dojox.widget.Portlet" title=" Listing" dragRestriction="true" >
<table width="100%" height="50%" border="0">
<tr><td>
<div id=" gridDiv " ></div>
</td></tr></table>
</div>
I am trying to remove horizontal scroll and also to display rows without vertical scrolling.
Please guide/ help in resolving this. Tried some options like (grid.resize(), autoHeight, autoWidth) but none worked yet.
Regards,
Sagar
enhanced grids have two main divs ("dojoxGridContent", "dojoxGridScrollbox") u can fined them using firebug once page rendered. below is part of how it is converted to html tags
<div role="presentation" dojoattachpoint="scrollboxNode" class="**dojoxGridScrollbox**" style="height: 461px; overflow: hidden;">
<div role="presentation" hidefocus="hidefocus" dojoattachpoint="contentNode" class="**dojoxGridContent**" style="height:100%; overflow-y:auto;">
you will need to override the overflow attribute for "dojoxGridContent" deiv e.x overflow-y: auto (which will set the vertical scrolling to true and the horizontal to false)
dojo.query('.dojoxGridContent').attr('style','overflow-y:auto;');
another approach is to increase the height of the "dojoxGridContent" div to be using same syntax aboec.

Why won't my jQuery UI modal dialog close in Internet Explorer 9?

I am working on an ASP.NET application in which I'm using several jQuery UI modal dialogs. They all work properly in Chrome and Firefox, but one of them will not close when I click the "X" in Internet Explorer 9. Clicking the "X" just makes this particular dialog "non-modal", in other words the greyed-out background goes away and I can interact with the form underneath, but the dialog itself doesn't close.
Here's the code that's creating the dialog, and the function which opens it:
<script type="text/javascript">
$(document).ready(function () {
//Setup dialog
$("#reinstatementForms").dialog({
autoOpen: false,
width: 500,
height: "auto",
modal: true,
resizable: false,
draggable: false,
open: function (event, ui) { $(this).css("display", "block"); },
close: function (event, ui) { $('body').find('#reinstatementForms').remove(); }
});
});
function ShowReinstatementForms() {
$(#reinstatementForms").dialog("open");
return false;
}
</script>
Here's the HTML/ASPX markup (abbreviated):
<div id="reinstatementForms" title="Reinstatement Forms Required" class="modalDialog" style="display: none;">
<h2 style="padding: 10px 0 10px 20px;">Reinstatement Forms Are Required</h2>
<p>
Lorem ipsum dolor sit amet....
</p>
</div>
I'm triggering this particular dialog from code behind (C#) based on a condition being true:
if (reinstatementForms)
{
string dialogScript = "ShowReinstatementForms()";
ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "ShowReinstatementForms", dialogScript, true);
}
Any clues how to make this work properly in IE? Again, my other modals (which are being called/triggered in different ways) work fine in IE (IE 9 - I don't have access to any other version at the moment).
I don't think it will work in FF or chrome. $(#reinstatementForms").dialog("open"); is missing ". It should be $("#reinstatementForms").dialog("open");
Good luck!

Issue with jQuery & Colorbox. Dynamic href not reflecting change after first occurence

I am having a strange issue with jQuery (1.4.2) and Colorbox (1.3.6). I have an hyperlink inside an Obout grid created via a GridTemplate. The issue is with a dynamic href that I am executing with JQuery as follows:
The grid hyperlink passes the Primary Key of a record to this function where I change the href of a link than opens an iframe inside a ColorBox lightbox. This works well on the first record pressed. However, every subsequent click executes the hyperlink with the first parameter passed.
Why is the href not refreshing or changing to the new parameter passed? Is there a better way to accomplish this?
function PopupLink(vReqItrID) {
var lnkPopup = $("a[id=lnkPopup]");
lnkPopup.attr("href", "VendorInfo.aspx?ReqItr=" + vReqItrID.toString());
lnkPopup.trigger("click");
}
<script type="text/javascript">
$(document).ready(function() {
// Assign the ColorBox - Popup iframe event to element
$("#lnkPopup").colorbox({ width: "90%", height: "85%", iframe: true, overlayClose: false });
});
</script><a id="lnkPopup" href="#" style="visibility: hidden;"></a>
<obout:gridtemplate runat="server" id="tplOpenRequest">
<Template>
<a id="lnkReqItr" href="javascript:PopupLink('<%# Container.DataItem("ReqItrID") %>')">Open Request</a>
</Template>
</obout:gridtemplate>
Any Help is greatly appreciated.
Thanks,
Diego.
Silly me,
I guess reading the Colorbox documentation would have helped. I could have just done...
function PopupLink(vReqItrID) {
$.fn.colorbox({ href: "VendorInfo.aspx?ReqItr=" + vReqItrID.toString(),
width: "90%", height: "85%", iframe: true,
overlayClose: false, open: true });
}
and forget about the trigger which was the part that was failing.
Thanks.

Resources