Timepicker change listener not working

telerikuicomponent

#1

I upgraded to 3.x.x and I noticed that propertyChange event is no longer working on my Timepicker
<TimePicker hour="{{ testTime.getHour() }}" minute="{{ testTime.getMinute() }}" propertyChange="onTimeChange"></TimePicker>
I realize theres a timeChange even and I’m using that instead:
<TimePicker hour="{{ testTime.getHour() }}" minute="{{ testTime.getMinute() }}" timeChange="onTimeChange" id="timepicker"></TimePicker>
Also, I have tried attaching an on listener on the js side with timepicker.on('timeChange', ...)
But it still doesnt work. ANy ideas? (I’m using JS)


#2

I ran into the same problem, but I use angular. I implemented the timeChange event like you, and then set the time to my codebehind member. like so:

<TimePicker time="{{testTime}}" timeChange="onTimeChange($event)" 
    id="timepicker">
</TimePicker>

#3

Thanks @shawn-pavel, this still doesnt work for JS though.


#4

What doesn’t work exactly? Does the onTimeChange event not get fired? Or does the time not get set?


#5

The time gets set (when I use a date type), but the onTimeChange doesn’t fire.


#6

Perhaps without the ($event) ? I’ve never uses plain nativescript, but the examples I see are formatted without the parameters. So I’m guessing here.


#7

Tried that also. And a lot more variations but it wouldn’t work.


#8

I noticed now that after setting the time, getting the element by id and attaching the listener works.
e.g timepicker .on('timeChange', ...) , I wonder why it doesn’t work from xml though.