$(document).ready(function () {
    $('#jstree').jstree({
        plugins: [
            "search"
        ],
        core: {
            check_callback: true,
            data: ajaxTree({
                url: "GeneralApi/GetPathContentTree",
                data: function (node) {
                    return JSON.stringify({ path: (node.text ? node.text : ''), textParent: (node.original ? node.original.textParent : '') });
                },
                success: function (children) {
                }
            }),
        },
    });

    $('#jstree').on("changed.jstree", function (e, data) {
        if (data.selected.length > 0) {
            $('#lblPath').text(data.node.original.textParent);
        }
    });
});

function save() {
    if ($('#lblPath').text() != '') {
        refreshParent('setDataTo(' + JSON.stringify({object: $('#lblPath').text()}) + ')');
        closeTopModal();
    }
    else {
        showMsgModal(0, window.top.specifyPath);
    }
   
}