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

Data not filling on changing the date range

10 Answers 41 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Nithin
Top achievements
Rank 1
Nithin asked on 09 May 2018, 02:17 PM

Hi 
I'm have implemented scheduler in my application and I was able to fill the scheduler with data.
The way I'm filling data is calling the API on load with one parameter as today's date and another as 10 days from today and i'm able to get it but the issue is when I change the date range.On calling the API again the I'm getting the response but scheduler is not getting filled for those dates, the current format is

$scope.schedulerOption={
     dataSource: {
    data:myService.getData(),
        schema: {
          model: {
            id: "taskId",
            fields: {
              taskId: { from: "TaskID", type: "number" },
              title: { from: "Title", defaultValue: "No title"},
              start: { type: "date", from: "Start" },
              end: { type: "date", from: "End" },
              description: { from: "Description" },
              RoomID:{ from: "RoomID" },
              isAllDay: { type: "boolean", from: "IsAllDay" }
            }
          }
        }
       }
}

The way I call dataSource

I did try read(),data() and fetch() the give errors while running.

10 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 11 May 2018, 10:21 AM
Hello,

I have inspected both the code and the dojo provided but it is not quite clear how to replicate the issue. Would you please elaborate but sharing the exact steps and the expected behavior so we could inspect it locally and be more helpful with a possible solution?

Regards,
Plamen
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Nithin
Top achievements
Rank 1
answered on 11 May 2018, 12:44 PM

Hi,

I have created the scheduler and inside the datasource object I'm calling the API for getting the data. Please check the link below...
the way i call the apis right now
On running the code on dojo you will be able to seein the console  that the datasource object is getting updated but no new data is getting shown on the scheduler.
This is the issue I'm facing

Thanks

0
Nithin
Top achievements
Rank 1
answered on 11 May 2018, 12:47 PM
I'm calling the update API inside the skip function
0
Plamen
Telerik team
answered on 14 May 2018, 10:26 AM
Hello,

In such case we recommend using the setDataSource method of kendo Scheduler as for example in this dojo example.

Regards,
Plamen
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Nithin
Top achievements
Rank 1
answered on 14 May 2018, 01:50 PM

Hi Plamen,
 As you have suggested I did try out setDataSource() in my application and it throws an error 

vm.service.getReservation(vm.startDate,vm.endDate).then(function(reservationResponse){
        vm.roomReservation=reservationResponse;
           scheduler.setDataSource({
        data:  vm.roomReservation,
        schema: {
            model: vm.model.getReservationChartModel()
        }
    });
});

 

This is how I call my API function and inside this I'm calling setDataSource function

0
Plamen
Telerik team
answered on 15 May 2018, 05:35 AM
Hello,

It is not quite clear what may be causing the error. Would you please try to isolate the scenario with the error so we could inspect it and be more helpful with a possible solution?

Regards,
Plamen
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Nithin
Top achievements
Rank 1
answered on 16 May 2018, 09:08 AM
hi,
I'm afraid as of yet we can't isolate the scenario as we haven't hosted our APIs. So, I was thinking if it is a problem the way I'm providing data property inside dataSource object.

As the documentation suggest we should use transport for read,update,delete etc ??
0
Plamen
Telerik team
answered on 17 May 2018, 06:53 AM
Hello,

From the provided information there is not way to know what is going wrong in the application and what is causing the issue. In such case it is difficult to predict if using transport read and update will work the way you want it. 

One thing that may be helpful is the scenario from this help topic where is described how to get only the events that are rendered in the current view from the server.

Regards,
Plamen
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Nithin
Top achievements
Rank 1
answered on 30 May 2018, 05:11 AM
Hi Plamen,
I was able to fix the error.I think one of the directives I'm using was interfering with the setDataSource(). After removing that it was working fine. 
0
Plamen
Telerik team
answered on 30 May 2018, 05:41 AM
Hi,

Thank you for sharing what solved the issue at your side.

Regards,
Plamen
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
General Discussions
Asked by
Nithin
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Nithin
Top achievements
Rank 1
Share this question
or