Greets,
I am currently running into an issue when working with the Kendo UI Scheduler and attempting to use two data sources (one which depends upon another) for both the resources and the scheduling events.
I have created a mock service which returns a random number of resources and a random number of events, each event tied to a specific resource. The JSON for a single event (in an event array) and the resource itself looks as follows for my 'mock' service:
[{ "resourceId":1, "timelineSchedules":[{ "sessionId":1, "start":"2016-02-08T03:00:00", "end":"2016-02-08T09:00:00", "status":14 }]}]My HTML page contains only one simple <div> element to host the calendar, as follows:
<div id="calendar"></div>
Now, here is an example of the JavaScript that I am using to read from the service (pared down to what is required), then also set the data in the secondary data source:
(function($, kendo, undefined) { var schedulingBlockDataSource = new kendo.data.SchedulerDataSource(), timelineDataSource = new kendo.data.SchedulerDataSource({ type: "json", batch: true, transport: { read: { type: "GET", dataType: "json", contentType: "application/json; charset=UTF-8", } }, change: function(e) { var timelineData = this.data(), schedules = new kendo.data.ObservableArray([]); $.each(this.data(), function(rowIndex, resourceRow) { $.each(resourceRow.timelineSchedules, function(index, element) { schedules.push(new kendo.data.SchedulerEvent({ id: element.sessionId, title: "Test", description: "Test", resourceId: resourceRow.resourceId, start: new Date(element.start), end: new Date(element.end) })); }); }); schedulingBlockDataSource.data(schedules); }, schema: { data: function(timelineData) { var resourceList = new kendo.data.ObservableArray([]); $.each(timelineData, function(index, element) { resourceList.push({ value: element.resourceId, resourceId: element.resourceId, text: "Room " + element.resourceId, timelineSchedules: element.timelineSchedules }); }); return resourceList; } } }); $(document).ready(function() { var scheduler = $("#calendar").kendoScheduler({ dataSource: schedulingBlockDataSource, navigate: function(e) { timelineDataSource.read(); }, views: ["timeline"], group: { resources: ["Rooms"], orientation: "vertical" }, resources:[ { field: "resourceId", name: "Rooms", dataSource: timelineDataSource }] }).getKendoScheduler(); }); })(jQuery, window.kendo);This works for a couple of time when doing navigation (using the 'Today' to navigate since I'm returning all mock scheduling events with the current date); however, eventually it will get the following error:
kendo.all.js:79184 Uncaught TypeError: Cannot read property '_continuousEvents' of undefinedSchedulerView.extend._renderEvents @ kendo.all.js:79184 if (!group._continuousEvents) {SchedulerView.extend.render @ kendo.all.js:78985DataBoundWidget.extend.refresh @ kendo.all.js:82705n.isFunction.f @ jquery.min.js:2Class.extend.trigger @ kendo.all.js:124Observable.extend._process @ kendo.all.js:6869Observable.extend.data @ kendo.all.js:6086kendo.data.SchedulerDataSource.change @ scheduler.js:36It appears that there is some type of synchronization going on within the calendar in which the events and the resources themselves are being rendered in the view, but they are out of sync. The service to which I am trying to fit the calendar to returns the resource and scheduling information, so only one service call is needed, but I need to "reshape" the data for both the resource list and the scheduling events from the same service results.
Is there something that I need to do in order to make sure that the refresh of the Scheduler is synchronized with the update and reshaping of the data for both my resource list and scheduler events? I am already going to extend the TimelineView with my own implementation, is there something I can do there or is this something that can be handled from within the data source itself? I need to be able to dynamically change the resource list and events without having to recreate the entire Scheduler. Any help would be appreciated.
I'm working with the Kendo UI batch editor in Chrome. When a user hits the tab key to navigate to the next cell, the page is hijacked and automatically does a page down action to scroll down the page.
This can be very frustrating for our Chrome users. It does not happen in Internet Explorer 11.
The undesired functionality can be reproduced in the batch editing example here:
http://demos.telerik.com/kendo-ui/grid/editing
Any ideas on how I can prevent this from happening?
Is there any way in Kendo Grid to display the sorting order on a multiple sortable grid?
I have a grid with multiple sort mode (sortable: { mode: "multiple"}).
When I sort on more than one column, is there a way to display the order in which sorting is applied on the grid?
For example, displaying the sort order as 1,2,3,.. on the respective column headers.
My goal: I want to perform an action (especially navigating to a new page) when the user double clicks / activates a row. I have seen several solutions to this. But these don't work well enough for me. One problem is that my Grid is populated by a remote read. I know the grid is creating dom elements for each row. The best time to attach events to these events would be at that creation. Doing that in the row template function is not possible, since it only returns an html string, not dom elements. Attaching them via html may be possible but also feels hacky. I don't really want to populate the html with generated javascript code.
At the moment I would probably try to monkey patch some internal grid function to achieve this....
Hi All,
I don't understand why the following snippet will not disable the button initially. I forked someone code and it's similar to what I got (http://jsfiddle.net/ze6mf3ck/2/). It's a toolbar with kendo.template inside of a grid and it's bind the demo-grid. CanVoid observable will be used depending on the conditions. How can I make the "void" button disabled initially? Am I missing something?
TIA
Hi,
I'm looking for a way to put a list of dates in bold and /or alter their background color. I'll receive a list in the model sent to this view, in the example below I just simulate the model I'll be expecting.
@{ var datesTest = new DateTime[]{new DateTime(2016, 2, 1),
new DateTime(2016, 2, 2),
new DateTime(2016, 2, 3),
new DateTime(2016, 2, 4),
new DateTime(2016, 2, 5)};
}
@(Html.Kendo().DatePicker()
.Name("datepicker")
.Culture("en-GB")
.Format("dd/MM/yyyy")
.Value(DateTime.Now)
.Max(DateTime.Today)
)
Can this easily be done?
Hello,
I have attached a picture of what i am trying to achieve. I need to dynamically change the pager when grouping and is there a possibility to keep the groups when changing pages ?
Thank you in advance.
Hi,
i created a datasource that's bound to a grid. When i edit a row of a grid and save the changes i do a sync. The update method is called and returned with an code of 200.
I then try to edit another row, but cancel this changes. In my cancel method of the datasource i call the dataSource.cancelChange() method.
But now all changes (even the synced ones) are reverted to the initial state ? Why ? What i am doing wrong in this scenario ?
Regards
Dirk