Scheduler Edit Item; onClick vs onClickAction

1 Answer 65 Views
Scheduler
Grant
Top achievements
Rank 3
Iron
Iron
Veteran
Grant asked on 16 Aug 2023, 11:15 AM

Hi Team,

Please can you explain what the difference is between `onClick` and `onClickAction` in the SchedulerEditItemProps. I read the docs and am still unclear which I should be using or when. Why are there 2 functions? What does each one achieve? Under what circumstances should I override `onClick` or`onClickAction`?

Thanks,
Grant

1 Answer, 1 is accepted

Sort by
0
Accepted
Wissam
Telerik team
answered on 18 Aug 2023, 08:15 AM

Hello, Grant,

The `onClick` event here is the basic HTML click event. On the other hand, the `onClickAction` event is defined for the `SchedulerEditItem` and it returns the HTML click event, the properties of the clicked-on dataItem, and the state of the clicked item:

Choosing between both events relies on the use case scenario. If you just need to capture the click event, then you can use `onClick`. The event also contains the properties of the item ( `event.target.props` ). However, if you additionally require the state properties of the item for a specific purpose, then you can use the `onClickAction`. For example, the formItem prop which can be passed to the SchedulerEditItem is available for the onClickAction `state` parameter.

Internally, the `onClickAction` is used inside the `onClick` event to set the properties of the selected item and the state values.

I hope this helps, but please let me know if you have any further questions.

Regards,
Wissam
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Kendo family, check out our getting started resources!

Tags
Scheduler
Asked by
Grant
Top achievements
Rank 3
Iron
Iron
Veteran
Answers by
Wissam
Telerik team
Share this question
or