Hi,
I am playing around with the schedule module , starting from this example: https://ej2.syncfusion.com/javascript/demos/#/material/schedule/default.html
I managed to get it working on my project with a dataManager and a remote source, all in fine!
Now in order to save bandwith, I tried to minimize the bundle as much as possible, because the example includes the whole ej2 global library as:
<script src="dist/ej2.min.js"></script>
Now, I tried to include all the module which schedule depends on like this:
<script src="https://cdn.syncfusion.com/ej2/ej2-base/dist/global/ej2-base.min.js" type="text/javascript"></script>
<script src="https://cdn.syncfusion.com/ej2/ej2-buttons/dist/global/ej2-buttons.min.js" type="text/javascript"></script>
<script src="https://cdn.syncfusion.com/ej2/ej2-data/dist/global/ej2-data.min.js" type="text/javascript"></script>
<script src="https://cdn.syncfusion.com/ej2/ej2-calendars/dist/global/ej2-calendars.min.js" type="text/javascript"></script>
<script src="https://cdn.syncfusion.com/ej2/ej2-dropdowns/dist/global/ej2-dropdowns.min.js" type="text/javascript"></script>
<script src="https://cdn.syncfusion.com/ej2/ej2-excel-exports/dist/global/ej2-excel-exports.min.js" type="text/javascript"></script>
<script src="https://cdn.syncfusion.com/ej2/ej2-lists/dist/global/ej2-lists.min.js" type="text/javascript"></script>
<script src="https://cdn.syncfusion.com/ej2/ej2-navigations/dist/global/ej2-navigations.min.js" type="text/javascript"></script>
<script src="https://cdn.syncfusion.com/ej2/ej2-popups/dist/global/ej2-popups.min.js" type="text/javascript"></script>
<script src="https://cdn.syncfusion.com/ej2/ej2-schedule/dist/global/ej2-schedule.min.js" type="text/javascript"></script>
Doing this, the schedule loads correctly, but all editing (add event, drag, open etc.) events do not work.
Im getting the following error:
util.js:5 Uncaught TypeError: Cannot read property 'quickPopupHide' of undefined
at i.e.eventDoubleClick (util.js:5)
and creating a new event by dbl clicking in an empty space:
util.js:5 Uncaught TypeError: Cannot read property 'openEditor' of undefined
Do I need to inject something ? I don't understand that part ...
I also tried to use webpack to generate a custom bundle, but I fail to generate a bundle which makes the global variable "ej" available like ej2.min.js does.
webpack config experiment:
module.exports = {
mode: 'development',
entry: './test.js',
output: {
filename: 'bundle.js',
libraryTarget: "var",
library: "ej"
},
}
In the resulting bundle, "ej" is not available globally.
Can you provide an example which provides only the resources needed for schedule instead of the whole ej2.min.js ?
I know this might be a newbie error, but at this point I am quite frustrated and need some advice ... thanks.