Hi all
how can i add onfocus event handler for a webdatechooser?
Thanks in advance
Hi Ken,
WebDateChooser does not raise focus event, because it can be misleading and fired when drop-down calendar is closed.
The easiest way to process focus event is use member variable inputBox which contains reference to actual input. Below is example:
<script type="text/javascript">function myFocus(){ //alert('focus');}function WebDateChooser1_InitializeDateChooser(oDateChooser){ oDateChooser.inputBox.onfocus = myFocus;}</script>
<igsch:WebDateChooser ID="WebDateChooser1" runat="server"> <ClientSideEvents InitializeDateChooser="WebDateChooser1_InitializeDateChooser"></ClientSideEvents></igsch:WebDateChooser>
You also may try to put similar codes inline for Initialize event. But they probably will contain something likeigdrp_getComboById('<%=WebDateChooser1.ClientID%>').inputBox.onfocus=...
which will not really clean, confusing (and not recommended).
Hi,
I was just looking at this thread as I have the same problem. The difference for me is, I would like to hook up the event on the server side. This is easy with every other control I've encountered; for example, ASP.NET controls allow:
control.Attributes.Add("onfocus", <code>);
And most Infragistics controls allow:
control.ClientSideEvents.Focus = <code>;
But the WebDateChooser control is giving me a problem. Can you help?
Thanks in advance,
Ken
You may process ClientSideEvents.InitializeDateChooser and add handler to inputBox member. Example:
However, that event may be raised while editor still has focus. For example, on close drop-down calendar.