I am looking at the documentation for the CSOM and I am not finding anything for the WebDatePIcker in particular the ValueChanged event.
Also are there any examples of using the CSOM?
ThanksRon
Hi Ron,
The ClientEvents.ValueChanged event is inverited from WebTextEditor. The evtArgs is instance of $IG.TextEditorValueChangedEventArgs class. If you cannot find docs for that event, then you may check available public functions from debugger: look at evtArgs and find methods with naming convention get_xxx(..) and set_xxx(...).
Below is example:
function valueChangedEvt(editor, evtArgs){ //debugger; alert("valueChangedEvt oldVal="+evtArgs.get_oldValue()+" newVal="+evtArgs.get_value());}
Thanks,
With the ASP.Net non-AJAX control I was able to do something like the following on the client side how can I do the same thing using the AJAX enabled controls?
<script type="text/jscript" language="javascript">
function showCaret(editor, evtArgs) {debugger;var dtArrival = new Date();var oArrival = GetControlByID("wdcArrival");if (!oArrival) return false;
var dtDeparture = new Date();var oDeparture = GetControlByID("wdcDeparture");if (!oDeparture) return false;
var oNights = GetControlByID("wcNights");if (!oNights) return false;var iNights = oNights.getvalue;
var msPerDay = 24 * 60 * 60 * 1000;dtArrival.setTime(oArrival.getvalue());if (isNaN(dtArrival)) return false;dtDeparture.setTime(dtArrival.getTime() + (iNights * msPerDay));oDeparture.setValue(dtDeparture);
}
function GetControlByID(sName, bCombo) {var ctlif (bCombo) {ctl = igdrp_getComboById(sName);} else {ctl = document.getElementById(sName);};
if (ctl) return ctl;//did not find the control by typical namevar allElms = document.body.getElementsByTagName("*");
for (var c = 0; c < allElms.length; c++) {var itm = allElms[c];if (itm.id) {if (itm.id.length > sName.length) {if (itm.id.substring(itm.id.length - sName.length).toLowerCase() == sName.toLowerCase()) {if (bCombo) {ctl = igdrp_getComboById(itm.id);if (ctl) return ctl;} else {return itm;};};};};};
return null;}
</script>
One other thing I have noticed is if you select a date with the dropdown calendar the value changed client sided event is not called and you also can not select today's date even though the current value is blank.
Thanks for your helpRon
No Problem I ended up having to use $find this gave me access to all the methods and events.
Now if I can figure out why the controls stop working after an ASYNC post back I will be in good shape.
Thanks for your help.Ron
I mistyped and missed "=" in last statement: "<%=xxx%>"
Thank you for report. Firing ValueChanged and ValueChanging events modified by calendar will be fixed. It did not fire because of a missing flag.
Those events are fired only after control loses focus. The WebDatePicker does not lose focus (like WebDateChooser), therefore, on open/close calendar editor keeps focus and those events are not supposed to fire, but TextChanged will be fired (not implemented in current version).
I am not sure about what supposed to do showCaret and GetControlByID. To get reference to any AJAX control you may use
var control = $get(clientID_ofControl);var dp = $get('<%WebDatePicker1.ClientID%>');