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,
Thank you for your feedback.
Feel free to contact us if you have any other questions or concerns.
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
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.
I also forgot to mention that i tried binding the following events to my igDatePicker:
$(function () { $("#txtDate").bind("igdatepickervaluechanged", FilterChanged); $("#txtDate").bind("igdatepickervaluechanged", FilterChanged); $("#cboDisplay").bind("igcomboselectionchanged", FilterChanged); });
function FilterChanged(event, args){ alert("Filter Changed!");}
The FilterChanged() event only fires when I make a change to the Combo, if I make a selection or type into the DatePicker, the event fails to fire.
What's going on?