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
95
WebDateChooser Show Drop Down
posted

Hello, I am dynamically creating several WebDateChooser controls for a search criteria table. I have disallowed users to enter dates manually, only allowing them to change the date by selecting from the date drop down. my question is: is it possible to have the webdatechooser drop down the date panel when the user clicks anywhere on the control (and not just on the arrow button)?. If anyone can help me, I would really appreciate it, Thank you!

Parents
  • 24497
    Verified Answer
    posted

    Hi,

    It is possible to process mousedown and click over input field and open calendar. Reference to input can obtained by inputBox member. Below is example to implement.

    <script type="text/javascript">
    function WebDateChooser1_InitializeDateChooser(oDateChooser)
    {
     // used to set "drop-down block" variable if calendar was already opened
     oDateChooser._myMouseDown = function()
     {
      var me = igdrp_getComboById('<%=WebDateChooser1.ClientID%>');
      if(me && me.isDropDownVisible())
       me._calOpenedTime = new Date().getTime();
     }
     // used to open 
     oDateChooser._myClick = function()
     {
      var me = igdrp_getComboById('<%=WebDateChooser1.ClientID%>');
      if(me && !me.isDropDownVisible() && (!me._calOpenedTime || me._calOpenedTime + 500 < new Date().getTime()))
       me.setDropDownVisible(true);
     }
     oDateChooser.inputBox.onmousedown = oDateChooser._myMouseDown;
     oDateChooser.inputBox.onclick = oDateChooser._myClick;
    alert('ok');
    }
    </script>
    <igsch:WebDateChooser ID="WebDateChooser1" runat="server">
      <ClientSideEvents InitializeDateChooser="WebDateChooser1_InitializeDateChooser"></ClientSideEvents>
    </igsch:WebDateChooser>

Reply Children