$.mockjax({
    url: '*',
    response: function(options) {
        this.responseText = ExampleData.example_data;
    },
    responseTime: 0
});

$(function() {
    var $tree = $('#tree1');
    $tree.tree();

    /*
    $tree.on('tree.init', function() {

    });
    */
    $('#get-selected').on('click', function() {
        var node = $tree.tree('getSelectedNode');

        if (!node) {
            console.log('no node');
        }
        else {
            console.log(node.name);
        }
    });
});
