Missing typescript definitions in kendo ui v2016.2.714

6 posts, 0 answers
  1. Bernd
    Bernd avatar
    53 posts
    Member since:
    Feb 2013

    Posted 16 Aug Link to this post

    Dear Telerik Team.

    I try to access a schedulerview's table and its resources to redefine the slot background colors. Unfortunately there are two properties missing to do that in typescript.

    In Javascript

    let view = scheduler.view();
    view.table.find("td[role=gridcell]").each(function () { ... });
    let resources = view.resources;

    works. In Typescript VS2015 shows me two errors. One at "table" anbd one at "resources".

    Can you please update the definitions file? Maybe in a not too far future? :)

    Thanks in advance

    Bernd

  2. Alex Hajigeorgieva
    Admin
    Alex Hajigeorgieva avatar
    115 posts

    Posted 18 Aug Link to this post

    Hello Bernd,

    To change the slot colours of the Kendo UI Scheduler, use the SchedulerView Interface slotTemplate property. A demo from the Kendo UI Scheduler How To documentation section is available at:

    http://docs.telerik.com/kendo-ui/controls/scheduling/scheduler/how-to/set-slot-background-color-using-slot-templates

    The Kendo UI typescript files are mostly automatically generated by the properties, fields, methods and events and their adjoining event data etc. as documented in the widgets public API. Currently, we are not planning to extend it to access DOM elements or other properties accessible via JavaScript inheritance not part of the documented public API, however, you could edit the file yourself with the desired definitions. 

    Finally, if you discover a property, method, event, etc which is documented in the public API but not present in the typescript file, please let me know and I will make sure it is added as soon as possible.

    Regards,
    Alex
    Telerik by Progress
     
    Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
  3. UI for ASP.NET AJAX banner
  4. Bernd
    Bernd avatar
    53 posts
    Member since:
    Feb 2013

    Posted 19 Aug in reply to Alex Hajigeorgieva Link to this post

    Hello Alex.

    Thank you for pointing me to the howto-documentation. That's a way to get rid of the "table" erro.

    Maybe there is a publicly supported / typescript way to get the schedulers resources? In my scenario I have different timeframes with different colors for each resource.

    Thanks in advance

    Bernd

  5. Bernd
    Bernd avatar
    53 posts
    Member since:
    Feb 2013

    Posted 19 Aug in reply to Bernd Link to this post

    One addition: I have to call a service to get the resource-timeframe-colours. So I can't use the example from the api docs where the resources are accessed by data.resources() in the template.
  6. Bernd
    Bernd avatar
    53 posts
    Member since:
    Feb 2013

    Posted 22 Aug Link to this post

    Hello Alex.

    ATM I try to find a workaround to my problem. Doing that I might have found a mistake in the kendo typescript definitions

    The SchedulerView contains two properties. startTime and endTime. In JS they both are funtions. Changing your defintion to the following makes my typescript work.

    interface SchedulerView {
        allDayEventTemplate?: string|Function;
        allDaySlot?: boolean;
        allDaySlotTemplate?: string|Function;
        columnWidth?: number;
        dateHeaderTemplate?: string|Function;
        dayTemplate?: string|Function;
        editable?: boolean|SchedulerViewEditable;
        endTime(): Date;
        eventHeight?: number;
        eventTemplate?: string|Function;
        eventTimeTemplate?: string|Function;
        group?: SchedulerViewGroup;
        majorTick?: number;
        majorTimeHeaderTemplate?: string|Function;
        minorTickCount?: number;
        minorTimeHeaderTemplate?: string|Function;
        selected?: boolean;
        selectedDateFormat?: string;
        showWorkHours?: boolean;
        slotTemplate?: string|Function;
        startTime(): Date;
        title?: string;
        type?: string;
        workWeekStart?: number;
        workWeekEnd?: number;
    }

    Please check if I am right or tell my how I convince typescript to accept a conversion to at UTC string.

    Thanks

    Bernd
  7. Alex Hajigeorgieva
    Admin
    Alex Hajigeorgieva avatar
    115 posts

    Posted 23 Aug Link to this post

    Hello Bernd,

    Please accept my apology for the delay in responding.

    You are correct in your observation that the Kendo UI Scheduler endTime  and startTime  definitions are incorrect. I will make sure they are fixed as soon as possible. As a token of gratitude for helping us improve, I have updated your Telerik points.

    Regarding the second question - I have modified our AngularJS Scheduler demo to include a service to illustrate how you can use the demo from our previous communication. There are a couple of things that should be stressed in this scenario:

    1) Ensure that synchronous operations are used
    2) Performance issues may arise if large requests need processing

    Please let me know if I am missing something - the demo is available at:

    http://dojo.telerik.com/UvEmuR

    Regards,
    Alex
    Telerik by Progress
     
    Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
Back to Top
UI for ASP.NET AJAX banner