Click here to Skip to main content
15,885,537 members
Please Sign up or sign in to vote.
1.50/5 (2 votes)
Hi There,

I am trying to develop a page using devexpress control, where a calendar control would open up in one modal pop up control. I am using the below javascript function to show the calendar control, but whenever I am trying to open the calendar control from a modal pop up, the calendar image is coming up behind the modal pop up and hence that is not clickable.

Javascript Function -----

C#
// implementation
function tcal(a_cfg, a_tpl) {

    // apply default template if not specified
    if (!a_tpl)
        a_tpl = A_TCALDEF;

    // register in global collections
    if (!window.A_TCALS)
        window.A_TCALS = [];
    if (!window.A_TCALSIDX)
        window.A_TCALSIDX = [];

    this.s_id = a_cfg.id ? a_cfg.id : A_TCALS.length;
    window.A_TCALS[this.s_id] = this;
    window.A_TCALSIDX[window.A_TCALSIDX.length] = this;

    // assign methods
    this.f_show = f_tcalShow;
    this.f_hide = f_tcalHide;
    this.f_toggle = f_tcalToggle;
    this.f_update = f_tcalUpdate;
    this.f_relDate = f_tcalRelDate;
    this.f_parseDate = f_tcalParseDate;
    this.f_generDate = f_tcalGenerDate;

    // create calendar icon
    this.s_iconId = 'tcalico_' + this.s_id;
    //alert(this.s_iconId);
    this.e_icon = f_getElement(this.s_iconId); //alert(this.s_iconId);
    if (!this.e_icon) {
        document.write('<img src="' + a_tpl.imgpath + 'cal.gif" id="' + this.s_iconId + '" onclick="A_TCALS[\'' + this.s_id + '\'].f_toggle()" class="tcalIcon" border="0" alt="Open Calendar" />');
        this.e_icon = f_getElement(this.s_iconId);
    }
    // save received parameters
    this.a_cfg = a_cfg;
    this.a_tpl = a_tpl;
}

function f_tcalShow(d_date) {
    vDateControlId = this.a_cfg.controlname;

    // find input field
    if (!this.a_cfg.controlname)
        throw ("TC: control name is not specified");
    if (this.a_cfg.formname) {
        var e_form = document.forms[this.a_cfg.formname];
        if (!e_form)
            throw ("TC: form '" + this.a_cfg.formname + "' can not be found");
        this.e_input = e_form.elements[this.a_cfg.controlname];
    }
    else
        this.e_input = f_getElement(this.a_cfg.controlname);

    if (!this.e_input || !this.e_input.tagName || this.e_input.tagName != 'INPUT')
        throw ("TC: element '" + this.a_cfg.controlname + "' does not exist in "
            + (this.a_cfg.formname ? "form '" + this.a_cfg.controlname + "'" : 'this document'));

    // dynamically create HTML elements if needed
    this.e_div = f_getElement('tcal');
    if (!this.e_div) {
        this.e_div = document.createElement("DIV");
        this.e_div.id = 'tcal';
        document.body.appendChild(this.e_div);
    }
    this.e_shade = f_getElement('tcalShade');
    if (!this.e_shade) {
        this.e_shade = document.createElement("DIV");
        this.e_shade.id = 'tcalShade';
        document.body.appendChild(this.e_shade);
    }
    this.e_iframe = f_getElement('tcalIF')
    if (b_ieFix && !this.e_iframe) {
        this.e_iframe = document.createElement("IFRAME");
        this.e_iframe.style.filter = 'alpha(opacity=0)';
        this.e_iframe.id = 'tcalIF';
        this.e_iframe.src = this.a_tpl.imgpath + 'pixel.gif';
        document.body.appendChild(this.e_iframe);
    }

    // hide all calendars
    f_tcalHideAll();

    // generate HTML and show calendar
    this.e_icon = f_getElement(this.s_iconId);
    if (!this.f_update())
        return;

    this.e_div.style.visibility = 'visible';
    this.e_shade.style.visibility = 'visible';
    if (this.e_iframe)
        this.e_iframe.style.visibility = 'visible';

    // change icon and status
    this.e_icon.src = this.a_tpl.imgpath + 'no_cal.gif';
    this.e_icon.title = 'Close Calendar';
    this.b_visible = true;
}


Below is the aspx file from where I am calling the function,

<dx:ASPxPopupControl ID="ShpAddress" runat="server" Modal="True" PopupHorizontalAlign="WindowCenter"
PopupVerticalAlign="WindowCenter" ClientInstanceName="ShpAddress" HeaderText="Select Ship Address and Delivery Date:"
CloseAction="None" AllowDragging="True" EnableAnimation="False" EnableViewState="true">
<ContentCollection>
<dx:PopupControlContentControl ID="PopupControlContentControl2" runat="server">
<dx:ASPxPanel ID="ASPxPanel1" runat="server" DefaultButton="btOK">
<PanelCollection>
<dx:PanelContent ID="PanelContent2" runat="server">
<table cellpadding="0" cellspacing="0">
<tr>
<td rowspan="3">
<div class="pcmSideSpacer">
</div>
</td>
<td>
<table>
<tr>
<td>
<asp:RadioButtonList ID="radiolist1" Width="300px" Height="50px" runat="server">
</asp:RadioButtonList>
<br />
</td>
</tr>
<tr>
<td valign="top">

<asp:TextBox ID="txtboxDelDate" onKeyPress="return onKeyPressForControls();" runat="server"> </asp:TextBox>
<script language="JavaScript" type="text/javascript">
new tcal({ 'formname': 'aspnetForm', 'controlname': 'ctl00_MainContent_ShpAddress_ASPxPanel1_txtboxDelDate' });
</script>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lbldeldate" runat="server" Text = "Actual Delivery Date subject to B2B agent review and approval"></asp:Label>
</td>
</tr>
<tr>
<td>
<dx:ASPxButton ID="ASPxButton1" runat="server" Text="OK" Width="80px" AutoPostBack="False">
<ClientSideEvents Click="function(s, e) { ShpAddress.Hide(); }" />
</dx:ASPxButton>
</td>
</tr>
</table>
</td>
<td rowspan="3">
<div class="pcmSideSpacer">
</div>
</td>
</tr>
</table>
</dx:PanelContent>
</PanelCollection>
</dx:ASPxPanel>
</dx:PopupControlContentControl>
</ContentCollection>
<ContentStyle>
<Paddings PaddingBottom="5px" />
<Paddings PaddingBottom="5px"></Paddings>
</ContentStyle>
</dx:ASPxPopupControl>

Could you please help me on this?

Thanks and Regards,
Aniket
Posted
Updated 29-Jun-16 8:28am
v2

1 solution

THis is been resolved. I have to change in the CSS file to resolve this issue.

Thanks,
Aniket
 
Share this answer
 
Comments
DaveTheFav 29-Jun-16 14:45pm    
Aniket, I know it's been over a year but do you recall what CSS change you had to make to get this to work?

Thanks,
Dave

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900