Telerik Forums
Kendo UI for jQuery Forum
2 answers
1.3K+ views

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",
                url: "http://localhost/jsnovaservices/api/timeline",
                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 undefined
SchedulerView.extend._renderEvents    @ kendo.all.js:79184    if (!group._continuousEvents) {
SchedulerView.extend.render           @ kendo.all.js:78985
DataBoundWidget.extend.refresh        @ kendo.all.js:82705
n.isFunction.f                        @ jquery.min.js:2
Class.extend.trigger                  @ kendo.all.js:124
Observable.extend._process            @ kendo.all.js:6869
Observable.extend.data                @ kendo.all.js:6086
kendo.data.SchedulerDataSource.change @ scheduler.js:36

It 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.

 

 

Ralph Quintero
Top achievements
Rank 1
 answered on 10 Feb 2016
4 answers
548 views
I have a filter row on a grid and it seems that every time the filter inputs are used (loss of focus from tabbing out, or clicked on if radio button, or selected if dropdown) the grid hits the server. I'd like the users to have to explicitly hit enter or press a button of my choice to actually perform the data source filter request. Any ideas?
Developer
Top achievements
Rank 1
 answered on 10 Feb 2016
4 answers
163 views

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?

Brandon
Top achievements
Rank 1
 answered on 10 Feb 2016
11 answers
768 views

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.


Mark
Top achievements
Rank 1
 answered on 10 Feb 2016
4 answers
354 views
Hi,

I was looking through the documentation to add alt/title text to the buttons inside a toolbar and saw the Attributes configurations.
I went on the "Edit this example" page and saw that even the example wasn't working...

Is there something extra that must be done for this to be working properly?

Thanks

http://docs.telerik.com/kendo-ui/api/javascript/ui/toolbar#configuration-items.attributes
Alexander Valchev
Telerik team
 answered on 10 Feb 2016
3 answers
78 views

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....

Dimiter Madjarov
Telerik team
 answered on 10 Feb 2016
2 answers
177 views

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

 

Boyan Dimitrov
Telerik team
 answered on 10 Feb 2016
1 answer
143 views

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?

Georgi Krustev
Telerik team
 answered on 10 Feb 2016
2 answers
115 views

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.

Dragos
Top achievements
Rank 1
 answered on 10 Feb 2016
2 answers
188 views

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

 

Rosen
Telerik team
 answered on 10 Feb 2016
Narrow your results
Selected tags
Tags
Grid
General Discussions
Charts
Data Source
Scheduler
DropDownList
TreeView
MVVM
Editor
Window
DatePicker
Spreadsheet
Upload
ListView (Mobile)
ComboBox
TabStrip
MultiSelect
AutoComplete
ListView
Menu
Templates
Gantt
Validation
TreeList
Diagram
NumericTextBox
Splitter
PanelBar
Application
Map
Drag and Drop
ToolTip
Calendar
PivotGrid
ScrollView (Mobile)
Toolbar
TabStrip (Mobile)
Slider
Button (Mobile)
Filter
SPA
Drawing API
Drawer (Mobile)
Globalization
LinearGauge
Sortable
ModalView
Hierarchical Data Source
Button
FileManager
MaskedTextBox
View
Form
NavBar
Notification
Switch (Mobile)
SplitView
ListBox
DropDownTree
PDFViewer
Sparkline
ActionSheet
TileLayout
PopOver (Mobile)
TreeMap
ButtonGroup
ColorPicker
Pager
Styling
Chat
MultiColumnComboBox
Dialog
DateRangePicker
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Accessibility
Effects
PivotGridV2
ScrollView
Switch
TextArea
BulletChart
Licensing
QRCode
ResponsivePanel
Wizard
CheckBoxGroup
Localization
Barcode
Breadcrumb
Collapsible
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
TaskBoard
Popover
DockManager
TimePicker
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
BottomNavigation
Ripple
SkeletonContainer
Avatar
Circular ProgressBar
FlatColorPicker
SplitButton
Signature
Chip
ChipList
VS Code Extension
AIPrompt
PropertyGrid
Sankey
Chart Wizard
OTP Input
SpeechToTextButton
InlineAIPrompt
StockChart
ContextMenu
DateTimePicker
RadialGauge
ArcGauge
AICodingAssistant
SmartPasteButton
PromptBox
SegmentedControl
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?