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

Try to load only events

1 Answer 88 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Joris
Top achievements
Rank 1
Joris asked on 12 Oct 2015, 09:02 PM

 Hi,

 A small problem I encountered when I switch to OData-v4 with scheduler.

I try to filter only the events that are visible in the scheduler control.

I Looks like to me that the parameterMap function is incorrect if the datasource is of type "odata-v4".

Found something like this kendo.data.transports.odata.parameterMap(options, type), but I'm still don't know how to add extra

filters. See code example for what I try to accomplish.

var schedulerDs = new kendo.data.SchedulerDataSource({
                type: "odata-v4",
                serverFiltering: true,
                transport: {
                    read: {
                        url: function() {
                            return "../odata/SchedulerEvents";
                        },
                        dataType: "json"
                    },
 
                    parameterMap: function (options, operation) {
 
                        if (operation === "read") {
                            var result = {
                                start: scope.schedularVar.view().startDate(),
                                end: scope.schedularVar.view().endDate()
                            }
 
                            return kendo.stringify(result);
                        }
 
                        return kendo.stringify(options);
                    }
                }

 

 

1 Answer, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 14 Oct 2015, 08:53 AM
Hi Joris,

Please note that the build-in "odata-v4" dataSource type already have "parameterMap" function defined and specifying another one in the dataSource configuration is not supported out of the box. Possible solution is to use regular dataSource with "parameterMap" function that first calls the "odata-v4" "parameterMap" and then includes the desired additional parameters to the generated result, however such solutions falls outside the scope of our support service as it covers the build-in functionality of the controls only. 

Regards,
Vladimir Iliev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Scheduler
Asked by
Joris
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Share this question
or