function reload()
{
    const libID = $(this).zui('picker').$.state.value;
    const link  = $.createLink('risk', 'importFromLib', 'projectID=' + projectID + '&from=project&libID=' + libID);
    loadPage(link);
}

$(document).off('click', '.import-btn').on('click', '.import-btn', function()
{
    const dtable = zui.DTable.query($(this).target);
    const checkedList = dtable.$.getChecks();
    if(!checkedList.length) return false;

    const url      = $('#importFromLibForm').attr('action');
    const formData = new FormData($("#importFromLibForm")[0]);
    checkedList.forEach((id) => formData.append(`riskIdList[${id}]`, id));

    $.ajaxSubmit({url: url, data: formData});

    return false;
});
