Error creating window

Get help with using Metro 4 components
Post Reply
brunogz
Posts: 13
Joined: Wed Oct 10, 2018 11:20 pm
Status: Offline

Error creating window

Post by brunogz » Sun Oct 14, 2018 12:58 pm

I'm using the desktop example to create windows but I'm encountering the following error:

desktop.js: 62 Uncaught TypeError: w.window is not a function
     at Object.createWindow (desktop.js: 62)
     at createWindow ((index): 269)
     at HTMLButtonElement.onclick ((index): 78)

The desktop.js file is the same as the example.
What can it be?

Thank you.

Code: Select all

    
<html>
...

    <div class="desktop bg-grayWhite">
        <div class="window-area" id="desktopArea"></div>
    </div>

<script>
    var w_icons = [
        'rocket', 'apps', 'cog', 'anchor'
    ];
    var w_titles = [
        'rocket', 'apps', 'cog', 'anchor'
    ];
    function createWindow(){
        var index = 1;
        Desktop.createWindow({
            width: 300,
            icon: "<span class='mif-"+w_icons[index]+"'></span>",
            title: w_titles[index],
            content: "<div class='p-2'>This is desktop demo created with Metro 4 Components Library</div>"
        });
    }

<script src="js/desktop.js"></script>
...
</html>
</script>

brunogz
Posts: 13
Joined: Wed Oct 10, 2018 11:20 pm
Status: Offline

Post by brunogz » Sun Oct 14, 2018 5:59 pm

Solved out. It was conflicting with DataTables.

Post Reply