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

Missing typescript definitions in kendo ui v2016.2.714

5 Answers 138 Views
Integration with other JS libraries
This is a migrated thread and some comments may be shown as answers.
Bernd
Top achievements
Rank 2
Bernd asked on 16 Aug 2016, 05:26 AM

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

5 Answers, 1 is accepted

Sort by
0
Alex Hajigeorgieva
Telerik team
answered on 18 Aug 2016, 07:34 AM
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.
0
Bernd
Top achievements
Rank 2
answered on 19 Aug 2016, 09:30 AM

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

0
Bernd
Top achievements
Rank 2
answered on 19 Aug 2016, 10:33 AM
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.
0
Bernd
Top achievements
Rank 2
answered on 22 Aug 2016, 01:48 PM

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
0
Alex Hajigeorgieva
Telerik team
answered on 23 Aug 2016, 11:51 AM
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.
Tags
Integration with other JS libraries
Asked by
Bernd
Top achievements
Rank 2
Answers by
Alex Hajigeorgieva
Telerik team
Bernd
Top achievements
Rank 2
Share this question
or