document.addEventListener('DOMContentLoaded', function() {
    //class가 calender인 inputbox용,날짜field용
    if (document.querySelector(".calender")) {
        $(".calender").datepicker({
            changeYear: true,
            changeMonth: true,
            yearRange: "-10:+0",
            dateFormat: "yy-mm-dd"
        });
    }
    if (document.querySelector(".batchjobuids_checkboxs")) {
        //id가 batchjobuids_checkbox인 버튼을 클릭시 class가 batchjobuids_checkboxs인 checkbox용
        $('#batchjobuids_checkbox').click(function (event) {
            if (this.checked) {
                $('.batchjobuids_checkboxs').each(function () { //loop checkbox
                    $(this).prop('checked', true); //check
                });
            } else {
                $('.batchjobuids_checkboxs').each(function () { //loop checkbox
                    $(this).prop('checked', false); //uncheck
                });
            }
        });
    }
    if (document.querySelector(".select-field")) {
        //class가 select-field인 SelectBox용
        $(".select-field").select2({
            theme: "classic",
            width: 'style',
            dropdownAutoWidth: true
        });
    }
});