The custom view in Kendo scheduler is not receiving the correct class upon selection

I've been working on a kendo scheduler for a client and they wanted me to implement a 3-day view. I managed to get it working, but there's one issue: the custom view doesn't receive the "k-state-selected" class when it's selected, which is causing styling problems.

I couldn't figure out why this is happening. None of the examples I looked at for creating a custom time view mentioned anything about defining the class that should be applied when the view is selected. It's strange because it does receive the "k-state-hover" class when hovered over.

Here's the relevant JavaScript code:

var ThreeDayView = kendo.ui.MultiDayView.extend({
    nextDate: function () {
        return kendo.date.nextDay(this.startDate());
    },

    options: {
        selectedDateFormat: "{0:D} - {1:D}"
    },

    name: "ThreeDayView",

    calculateDateRange: function () {
        //create a range of dates to be shown within the view
        var start = this.options.date,
            idx, length,
            dates = [];

        for (idx = 0, length = 3; idx < length; idx++) {
            dates.push(start);
            start = kendo.date.nextDay(start);
        }

        this._render(dates);
    }
});

$("#scheduler").kendoScheduler({
       date: new Date(), // The current date of the scheduler
       showWorkHours: true,
       height: 600,
       views: [
           "week",
           { type: ThreeDayView, title: "3 Jours", selected: false },
           "day"
       ],
       editable:
           {
               resize: true,
               move: true,
               template: $("#templateEdition").html()
           },
       dataSource: finalSource,
       add: onAdd,
       edit: onUpdate,
       remove: onDelete,
       save: onSaving
   })
});

Any ideas on why this might be happening? Thanks!

Answer №1

Make sure to specify the view type as a string, such as "ThreeDayView", instead of just ThreeDayView.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

The sign-up modal will refresh and then close when an API call is triggered upon submission in Next.js

Within my modal component, I have incorporated a feature that displays either a sign-in or sign-up form based on certain conditions. However, I am facing an issue where upon clicking the submit button on any of these forms, the modal closes regardless of t ...

Exploring elements in Javascript

I am attempting to retrieve values from various elements when a 'a' element is clicked. Consider the following code: <tr data-id="20"> <div class="row"> <td> <div class="btn-group"> <a data-checked= ...

Learn how to use jQuery to fetch data and dynamically display it on a webpage

Looking to retrieve data from MySQL using jQuery and dynamically display it on a web page. I attempted the following code but encountered issues. <html> <head> <script src="jquery-1.7.2.js"></script> </head> <body> &l ...

Click on an item in the list to remove it from the list

I am working with an object that contains multiple arrays of objects. I need help figuring out how to remove a single item from the list when clicked on. Although I know that using splice can achieve this, I'm unsure about implementing it in this spe ...

How can I use jQuery to implement a progress bar for Iframes loading?

My job involves working on an intranet where I have a complex aspx page with multiple Iframes, all of which we control. Each iframe is dynamically set using JavaScript/jQuery by different buttons on the page. Some buttons set the src attribute for iframes ...

Error: Unable to access the 'stopPropagation' property of a null object - ReactJS

React Component export default class CommentBox extends React.Component { constructor() { super() this.state ={ showComments: false, comments: [ { id: uuid.v4(), author: 'Clu', body: 'Just say no to love!&apos ...

What are the steps to perform various searches using a radio select button?

I am attempting to retrieve different results based on the selection of radio buttons. In my code, there are three buttons. I want the queries to execute differently based on the user's selection criteria, such as selecting TSM, SR, from, to dates, an ...

Element with a fixed position located inside a column in Bootstrap 4

Is there a way to keep a bar fixed at the bottom of the user's screen, but only within a specific column? Applying position:fixed; bottom:0; stretches the element across the entire screen, so how can I make the bar remain within the column boundaries? ...

Tips for transferring multiple form data changes from a child component to its parent in a React component

Is there a way to display real-time user input from input tags by the user without encountering re-render issues? I'm currently using useState to pass multiple user inputs from a child element to a parent element as an object. However, when the user t ...

Use PHP to transform an array into JSON format, then access and retrieve the JSON data using either jQuery or JavaScript

I have successfully generated JSON data using PHP: $arr = []; foreach($userinfo as $record) { $arr[] = array( 'BAid' => $record->getBAid(), 'BCid' => $record->getBCid(), 'BA ...

ReactJS input range issue: Cannot preventDefault within a passive event listener invocation

I've been encountering some issues with the react-input-range component in my React App. It functions perfectly on larger viewports such as PCs and desktops, but on smaller devices like mobile phones and tablets, I'm seeing an error message "Unab ...

Saving events with a Full Calendar is a seamless process that

I am encountering a problem while trying to save the end time and enable dragging across multiple days on my fullcalendar. I have configured it to save data using jQuery.post to my database, but I am struggling to populate the end value and allow it to be ...

What is the best way to access a nested promise element in Protractor?

I've recently put together a function in protractor that I'd like to share: function findChildElementByText(parentElement, tagName, textToSearch) { return parentElement.all(by.tagName(tagName)) .then((items) => { items.map( item ...

What is the best way to assign the value of a specific key in one array as the key in a different array?

I am attempting to retrieve the value feature_1 associated with the key name from the array data. I then aim to set feature_1 as the key of another array asset, with an array as its corresponding value. For example: //input: data: { name: "feature_1" ...

Encountering issues with properly implementing the .replaceWith(jQuery('#content')) function in CodeIgniter

I'm having trouble with using the jQuery function .replaceWith(jQuery('#content') in Codeigniter. While I can successfully replace the "content" part of my html, the page background image is not showing up. Controller: public function inde ...

Utilize graphics in three.js for texture recycling

My challenge involves loading the same image in a large number (~ 1000) of two-dimensional shapes using three.js, each shape with different offsets. I came across this demo on the official website and modified it to create my own demo, featuring various s ...

Can data from an Angular app be accessed by an external JavaScript code within the same project?

I've been thinking about a theoretical scenario that luckily I haven't encountered yet. Imagine I have an Angular Project compiled in My PROJECT FOLDER. <br/> Inside this PROJECT FOLDER, there's another JAVASCRIPT FILE external to ...

multiple event listeners combined into a single function

I'm looking to streamline my button handling in JavaScript by creating just one function that can handle all the buttons on my page. Each button will trigger a different action, so I need a way to differentiate between them. I thought of using one eve ...

Selection status of Fabric.js objects: selected or unselected

With Fabric.js, I have created a text object called header. When the header is selected, a div appears with two input fields for text and fill. This functionality is working as expected. My next task is to make the div fade out when the header object is d ...

Converting from $ajax to fetch: A step-by-step guide

Currently, I am utilizing Ajax with jQuery in my React component. However, I want to switch to using Fetch but I am having some trouble with the syntax. Here is my current implementation: handleDeleteProject(projectID) { $.ajax({ url: './ ...