I have an Infragistics 12.1 jQuery DatePicker on my page and I'm trying to read the value (client-side) of the DatePicker, when another control's event is fired.
I've tried the following methods in an attempt to retrieve the DatePicker's value but each one seems to return an instance of the DatePicker itself:
alert($("#txtDate").igDatePicker("text"));alert($("#txtDate").igDatePicker("value"));alert($("#txtDate").igDatePicker("getSelection"));alert($("#txtDate").igDatePicker("getSelectedText"));
Each one returns an Object which appears to be an instance of the DatePicker itself because if I enumerate through the properties of the returned object, I can see internal methods such as init(), trigger(), toggle(), die() igDatePicker(), etc.
My MasterPage should be fine because I've also got a igCombo on the same page and am having no issues accessing its value. Here is what I have in my MasterPage:
<script type="text/javascript" src="/Scripts/Infragistics/jQuery/infragistics.loader.js"></script> <script type="text/javascript" src="/Scripts/jquery-ui.js"></script> <%= Html.Infragistics() .Loader() .ScriptPath("/Scripts/Infragistics/jQuery/") .CssPath("/Styles/Infragistics/jQuery/") .Render() %>
Can anyone help??
Thank you in advance
Hi Andrew,
The MVC Wrappers for igEditor related controls(igDatePicker is one of them) instantiate igEditor control on the client side(you can see it yourself by examining the JavaScript code generated by the MVC Wrapper in your page), so you should use igEditor instead of igDatePicker in order to use the API. The same is for the event handling.
Please read Configuring igEditors at Runtime topic for more information.
Best regards,
Martin Pavlov
Infragistics, Inc.
Thank you Martin! Your solution solved all my problems.
However, this begs the question, why does your documentation not reflect this? All syntax/API usage I originally had was found here: http://help.infragistics.com/jQuery/2012.1/ui.igdatepicker
Had you not responded, I could easily see myself being stuck on this issue for a very long time.
Thanks again,
Andrew
Thank you for your feedback.
Feel free to contact us if you have any other questions or concerns.