This is a migrated thread and some comments may be shown as answers.

Triggering a 'rebind' dataBinding event manually?

2 Answers 543 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Tyler
Top achievements
Rank 1
Tyler asked on 27 Mar 2017, 06:27 PM

I have code running in my dataBinding event for my scheduler that only runs if it is a 'rebind' event. However, there is a place in my code where I want that code to run, so doing something like:

scheduler.trigger('dataBinding') triggers the dataBinding event... but doesn't give it an action, like 'rebind', which I need it to have to run that code.

 

Is there a way to trigger a rebind dataBinding event manually in my javascript?

2 Answers, 1 is accepted

Sort by
0
Ianko
Telerik team
answered on 29 Mar 2017, 11:03 AM

Hello Tyler,

You can call scheduler.trigger("dataBinding", { action: "rebind" }).

If, however, you need to rebuilding the scheduler using the built-in DataSource, you can call refresh method or scheduler.dataSource.read() and scheduler.refresh().

Regards,
Ianko
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Tyler
Top achievements
Rank 1
answered on 29 Mar 2017, 02:09 PM
Thank you! That did the trick. My dataBinding is refreshing the scheduler, but I have other code going on in dataBinding that I want to execute when certain things happen on my page, so I was needing to trigger it manually.
Tags
Scheduler
Asked by
Tyler
Top achievements
Rank 1
Answers by
Ianko
Telerik team
Tyler
Top achievements
Rank 1
Share this question
or