Hello guys !!!!!
How can i get the selected value of a Webcalender using javascript ???
Please suggest !!!
When working with Infragistics ASP.NET controls in JavaScript, you will want to use our Client Side Object Model. To obtain the JavaScript object use the appropriate utility function (almost each control type will have its own utility function). Once you have the object you can access that object's specific properties and methods.
If using a WebDateChooser, it would be something like this:
var dateChooser = igdrp_getComboById('WebDateChooser1'); var selectedDate = dateChooser.getValue();
If using a WebCalendar, it would be somethign like this:
var webCal = igcal_getCalendarById('WebCalendar1'); var selectedDate = webCal.getSelectedDate();
Documentation on our CSOM (go to the last Child Node of ASP.NET):
http://help.infragistics.com/NetAdvantage/NET/2008.1/CLR2.0/
It is recommended that you use code rendering blocks, if your controls will be nested. This usually means inside of tabs, using master pages, or user controls.
ie. var webCal = igcal_getCalendarById('<%= WebCalendar1.ClientID %>');
Documentation on Code Rendering Blocks:
http://msdn2.microsoft.com/en-us/library/k6xeyd4z(VS.71).aspx
Thanks for this info, Sum Kim.
We have a WebDateChooser control on a Panel in a Master Page. Given the following code...
<script type="text/javascript">window.onload=activate; function activate() { alert ('<%= wdcDateOfBirth.ClientID %>'); var dateChooser = gdrp_getComboById('<%= wdcDateOfBirth.ClientID %>'); }</script>
The alert call is returning a ClientID of ctl00xContentPlaceHolder2xWebPanel5xwdcDateOfBirth. However, the gdrp_getComboById call is leading to an 'Object Expected' error. Is there something we're missing here?Also, once we have the WebDateChooser object, what is the easiest way to set a new date for this control on the client side. For example, would the following work?
dateChooser.SetValue("2008-5-5");
Thanks in advance
Thanks evrybody for your replies !!!!
It helped [:)]
Whoops...looks like I trimmed the full name of the function as I was using gdrp_getComboById rather than igdrp_getComboById. After this change, we now have a reference to the WebDateChooser control.