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!
Hi,
If I understood correctly, datechooser is located in template which is instantiated multiple times (like in repeater).In this case you may use igdrp_getComboById only if you know exact value of ClientID of particular datechooser. If you do not know how to get that or it is not possible, then you have 2 options:
1. Process Initialize ClientSideEvents, create a global var/array to store ids and fill it while processing that client event. The id can be obtains as oDateChooser.ID where oDateChooser is first param in handler.
2. Find reference to desired dateChooser within igdrp_all object:if(typeof igdrp_all == 'object') for(var id in igdrp_all) { if(igdrp_all[id] && igdrp_all[id].ID) alert('id:' + id + " ref:" + igdrp_all[id]); }
if WebDateChooser is in the gridview, how can I get the ids?
var me = igdrp_getComboById('<%=WebDateChooser1.ClientID%>');
Great, Thanks for your help!
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>