React/TypeScript and Initialization


#1

Hello,

I want to evaluate the Scheduler before buying it, but I don’t get on how to use it with React/TypeScript.

I followed this :


But I don’t find how to write this in typescript, especially the parts with this.schedulerContainer:
scheduler.init (can’t find schedulerContainer in the type properties)
render method (not very familiar with refs and don’t know where this.schedulerContainer comes from)

any tips please ?

Thanks


#2

nevermind… added this:

private schedulerContainer = document.getElementById(“scheduler-container”);


#3

I now face another problem, I want the timeline view.
I get this error:
Error: scheduler.createTimelineView is not implemented. Be sure to add the required extension: ext/dhtmlxscheduler_timeline.js, ext/dhtmlxscheduler_treetimeline.js, ext/dhtmlxscheduler_daytimeline.js

How to do that in React/Typescript ?
Thianks


#4

Hello @David-TS ,
You can add extensions using import, in your app component(scheduler.component.js):

import 'dhtmlx-scheduler/codebase/ext/dhtmlxscheduler_timeline.js';
import 'dhtmlx-scheduler/codebase/ext/dhtmlxscheduler_daytimeline.js';
import 'dhtmlx-scheduler/codebase/ext/dhtmlxscheduler_treetimeline.js';

Example of project structure:

After that you should do 2-4 steps from the following article:
https://docs.dhtmlx.com/scheduler/timeline_view.html