JSFiddle - React, Tailwind, and code Playground

by Pavel Savushchyk

HTML

<script src="http://localhost:8080/trunk/client/visualize.js"></script>

<button>Destroy</button>
<div id="container"></div>

CSS

#container {
    width: 800px;
    height: 500px;
}

JavaScript

visualize({
    auth: {
        name: "superuser",
        password: "superuser"
    }
}, function (v) {
    var dashboard = v.dashboard({
        resource: "/public/Samples/Dashboards/1._Supermart_Dashboard",
        container: "#container",
        error: function(e) {
            console.log(e);
        }
    });
    
    $("button").on("click", function(e) {
        dashboard
            .destroy()
            .fail(function(e) { alert(e); })
            .done(function() { console.log("dashboard destroyed"); });
    });
    
});