Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
40
Open WebDateChooser on focus and Close DateChooser on lost focus.
posted

function

wdcDOB_InitializeDateChooser(oDateChooser)

{

 

// used to open

oDateChooser._myClick =

function()

{

 

var me = igdrp_getComboById('<%=wdcDOB.ClientID%>');

 

if(me && !me.isDropDownVisible() && (!me._calOpenedTime || me._calOpenedTime + 500 < new Date().getTime()))

me.setDropDownVisible(

true);

}

oDateChooser._myFocusin =

function()

{

 

var me = igdrp_getComboById('<%=wdcDOB.ClientID%>');

 

if(me && !me.isDropDownVisible())

{

me.setDropDownVisible(

true);

}

}

oDateChooser._myFocusout =

function()

{

 

var me = igdrp_getComboById('<%=wdcDOB.ClientID%>');

 

if(me && me.isDropDownVisible())

{

 

var dropDownPanelContainer = '<%=wdcDOB.ClientID%>' + "_DrpPnl";

 

if(document.activeElement.id.indexOf(dropDownPanelContainer) < 0)

{

me.setDropDownVisible(

false);

}

}

}

oDateChooser._myChange =

function()

{

 

var me = igdrp_getComboById('<%=wdcDOB.ClientID%>');

 

if(me && me.isDropDownVisible())

{

me.setDropDownVisible(

false);

}

}

oDateChooser.inputBox.onclick = oDateChooser._myClick;

oDateChooser.inputBox.onchange = oDateChooser._myChange;

oDateChooser.inputBox.onfocusin = oDateChooser._myFocusin;

oDateChooser.inputBox.onfocusout = oDateChooser._myFocusout;

 

 

}

Parents
No Data
Reply
  • 24497
    posted

    Hi Dharshan,

    I copied those codes to a test website, added WebDateChooser with ID="wdcDOB" and it seemed to work as you probably expected. On click/focus calendar was opened and it was closed on lost focus.

    I did not analyze flow of logic, but I noticed _calOpenedTime. There is no such variable in ig_WebDropDown.js and that variable is never set by application. So, it is a dummy and it has no impact on behavior.

Children
No Data