0

I'm getting getting "ej.navigations is undefined" error when I'm using "https://cdn.syncfusion.com/ej2/ej2-navigations/dist/global/ej2-navigations.js"

When I try to use "https://cdn.syncfusion.com/ej2/ej2-navigations/dist/global/ej2-navigations.min.js" I get this error "Uncaught TypeError: r is undefined"

But everything works when I use "https://cdn.syncfusion.com/ej2/dist/ej2.min.js"

Since ej2 in itself is a big file I'm trying to only use the resources I need. I'm loading the js in the following order

<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-navigations/dist/global/ej2-navigations.min.js" type="text/javascript"></script>

And my usage for the ej.navigations is something like

modifierTree = new ej.navigations.TreeView({
        fields: { id: 'nodeId', text: 'nodeText', child: 'nodeChild' },
        showCheckBox: true,
        nodeChecked: function() {
            if (!modifierCheckedAuto) {
                updateGraph();
            }
        },
    });

Thank you in advance for the help

1 Answers1

0

Thanks to the folks at Syncfusion Support. They solved my issue.

I was missing all the dependencies required to use TreeView. Adding the additional dependencies solved my issue.

<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-data/dist/global/ej2-data.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-popups/dist/global/ej2-popups.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-inputs/dist/global/ej2-inputs.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>