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

Scheduler refresh

5 Answers 322 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
James asked on 07 Feb 2016, 06:43 PM

Hi guys,

 

in my scenario I show only one day - view as we  use the scheduler for building complex agendas with many rooms. When an user adds (or edits existing event) at the bottom of the custom edit box is an option to move the session to another day. If user selects other day and clicks on the save button on the controller we change start/end date of the session and save that to the database 

 

 var item = eventService.GetAgendaDay(sesssion.EventAgendaDayId); //selected id of the another day

//changing start/end date 
                sesssion.Start = new DateTime(item.Date.Year, item.Date.Month, item.Date.Day, sesssion.Start.Hour, sesssion.Start.Minute, sesssion.Start.Second);
                sesssion.End = new DateTime(item.Date.Year, item.Date.Month, item.Date.Day, sesssion.End.Hour, sesssion.End.Minute, sesssion.End.Second);

 and once we perform the save option we return the session back

 

 return Json(new[] { sesssion }.ToDataSourceResult(request, ModelState));

 

At this moment, the newly created session/or edited belongs to the another day and it should not be visible anymore on the screen, but it is. that is reason why I'm asking how to manualy refresh the source after save

 

thanks

5 Answers, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 09 Feb 2016, 08:42 AM
Hi James,

I'm not sure that I understand correctly what is the exact scenario that you have - could you please provide small runable example where the issue is reproduced? This would help us get better overview of the exact setup that you have and advice you better how to proceed. 

Regards,
Vladimir Iliev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
James
Top achievements
Rank 1
answered on 09 Feb 2016, 10:05 AM

Hi Vladimir,

 

I think I went into too details in my first post and I can't expose any part of the solution due privacy agreement with the client.

 

Let me try to rephrase my question 

 

In short: we need to refresh manually the scheduler's  once a new event has been saved. So user clicks on the we fire add/edit event custom window, User enters details about the event, clicks on the save button, browser submits data to the controller, controller saves it and returns 

return (new[] { task }.ToDataSourceResult(request, ModelState)); back to the browser 

 

At this  we want to manually refresh data source via . Is there an event that that we can use? We tried Events(a=>a.Save("")) but this event fires before submitting data to the controler 

 

 

0
Accepted
Vladimir Iliev
Telerik team
answered on 10 Feb 2016, 09:43 AM
Hi James,

You can utilize the "Save" event of the Scheduler to track next "DataBinding" event where to call the "read" method of the DataSource:

function onSave(e) {
    this.one("dataBinding", function(e) {
        e.preventDefault();
        this.dataSource.read();
    });
}

Regards,
Vladimir Iliev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
James
Top achievements
Rank 1
answered on 10 Feb 2016, 03:40 PM
This is exactly what I needed. Thank you so much!
0
Lee
Top achievements
Rank 1
answered on 08 Mar 2017, 01:13 PM
Thank you, Vladimir - this solved my problem.
Tags
Scheduler
Asked by
James
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
James
Top achievements
Rank 1
Lee
Top achievements
Rank 1
Share this question
or