Our pure JavaScript Scheduler component


Post by vladyslav.l »

We have purchased scheduler and now trying to integrate it in our system (Version 4.0.3).
Added sources in a way like this:

<script type="text/javascript" src="/[path]/scheduler.umd.js"></script>
<link rel="stylesheet" href="/[path]/scheduler.classic.css" id="bryntum-theme">

and add dependency in our js module like this:

define('module', ['scheduler'], f);

The result of this steps I've attached as image.
Сould you please point me to what I'm doing wrong.
Thanks!

Attachments
Screenshot 2020-11-25 173350.png
Screenshot 2020-11-25 173350.png (40.18 KiB) Viewed 683 times

Post by mats »

Could you please wrap up a test case? Sounds very odd. Works fine in our UMD examples (please try):

https://bryntum.com/examples/scheduler/basic/index.umd.html

Console:

scheduler.destroy()
new bryntum.scheduler.Scheduler({ appendTo : document.body })

Post by vladyslav.l »

Here, check please.

<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Tets</title>
  <link rel="stylesheet" href="scheduler.classic.css" id="bryntum-theme">
</head>
<body>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.js" integrity="sha512-vRqhAr2wsn+/cSsyz80psBbCcqzz2GTuhGk3bq3dAyytz4J/8XwFqMjiAGFBj+WM95lHBJ9cDf87T3P8yMrY7A==" crossorigin="anonymous"></script>
  <script type="text/javascript" src="scheduler.umd.js"></script>
  <script type="text/javascript" src="test.js"></script>
  <script type="text/javascript">
	require(['test'], function() {debugger;})
  </script>
</body>
</html>
Attachments
test.js
(289 Bytes) Downloaded 78 times

Post by mats »

Not sure what's going on but guessing some polyfill clash. It works fine if you move the scheduler script above the requirejs one.

You can try this demo showing how to use requirejs too: https://bryntum.com/examples/scheduler/requirejs/

What's your usecase for RequireJS / jQuery now that we have imports etc?


Post by vladyslav.l »

The whole project was written using RequireJS and we also support IE browser.
I found the solution, by manually adding scheduler to window, from RequireJS arguments.

(function (f, define) {
	define('test', ['scheduler'], f);
})(function (scheduler) {
	window.bryntumScheduler = scheduler;
	...
	return window;
}, typeof define === "function" && define.amd ? define : function (_, f) {
	f();
});

Post by mats »

Thanks for sharing your solution :)


Post Reply