Bundle trouble with schedule

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.


3 Replies 1 reply marked as answer

PN Praveenkumar Narasimhanaidu Syncfusion Team February 8, 2021 11:19 AM UTC

Hi Bob, 

Greetings from Syncfusion support..! 

We have validated your reported problem at our end and found that you have missed to add following links in your code, which is cause for the issue. Please add below mentioned links in your sample. We have also prepared a sample for your reference which is available in below link. 

  <script src="https://cdn.syncfusion.com/ej2/ej2-inputs/dist/global/ej2-inputs.min.js" type="text/javascript" /> 


Kindly try the above sample and get back to us if you need any further assistance. 

Regards, 
Praveenkumar. 


Marked as answer

BO Bob February 20, 2021 09:50 AM UTC

Hi,

thanks so much for your support ! I missed one indeed ... furthermore it seems to matter in what order you load the different JS modules. I packed them all into one JS file to reduce the number of HTTP requests, works as well.

Thanks again!

Bob


NR Nevitha Ravi Syncfusion Team February 22, 2021 05:27 AM UTC

Hi Bob, 

You are most welcome..! Please get back to us if you need any further assistance. 

Regards, 
Nevitha 


Loader.
Up arrow icon