1
2
3
$('#테이블아이디').on("click""button#버튼아이디", function() {
        $(this).closest("tr").remove()
    });    
cs



HTML <HAED>부분에 스크립트추가

<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>


기존의 alert("메세지)를 바꿔쓰려면


swal({
   title: "타이틀",
   text: "내용",
   icon: "info" //"info,success,warning,error" 중 택1
})




기본 alert()을쓸때 


alert("hello world");



스위트알럿을쓸때

swal({
    title: "Hello",
    text: "World!",
    icon: "info" //"info,success,warning,error" 중 택1
});







기존의 confirm("Y/N?") 을 바꿔쓰려면

swal({
     title: "타이틀",
     text: "내용",
     icon: "info" //"info,success,warning,error" 중 택1
     buttons: ["YES", "NO"],
}).then((YES=> {
     if (YES) {
     /* "YES"클릭시 로직 */
     }
});




기존의 confirm()을 쓸때

var flag = confirm("Y/N?");
console.log(flag);




스위트알럿을 쓸때

var flag;
var swal = swal({
    title: "Y/N?",
    text: "",
    icon: "info",
    buttons: ["NO""YES"]
}).then((YES=> {
    if (YES) {
        flag = true;        
    }else{
        flag = false;
    }
});

Promise.all([swal]).then(function(){
    console.log(flag);
});

1
2
3
4
5
6
7
8
9
10
11
12
13
14
$.ajax({
            method:"post",
            url:"",
            data:{
                params: JSON.stringify({
                    a:$("#a").val();
                    b:$("#b").val();
                    c:$("#c").val();
                    d:$("#d").val();
                    e:$("#e").val();
                    f:$("#f").val();
                    g:$("#g").val();
                })
            },
cs


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
//기본 시작날짜가 종료날짜보다 크게x
//       종료날짜가 시작날짜보다 작게x  
var dates = $( "#startDate, #endDate ").datepicker({
          prevText: '이전 달',
          nextText: '다음 달',
          monthNames: ['1월','2월','3월','4월','5월','6월','7월','8월','9월','10월','11월','12월'],
          monthNamesShort: ['1월','2월','3월','4월','5월','6월','7월','8월','9월','10월','11월','12월'],
          dayNames: ['일','월','화','수','목','금','토'],
          dayNamesShort: ['일','월','화','수','목','금','토'],
          dayNamesMin: ['일','월','화','수','목','금','토'],
          dateFormat: 'yy-mm-dd',
          showMonthAfterYear: true,
          yearSuffix: '년',
          onSelect: function( selectedDate ) {
            var option = this.id == "startDate" ? "minDate" : "maxDate",
              instance = $( this ).data( "datepicker" ),
              date = $.datepicker.parseDate(
                instance.settings.dateFormat ||
                $.datepicker._defaults.dateFormat,
                selectedDate, instance.settings );
            dates.not( this ).datepicker( "option", option, date );
          }
     });
 
//최소 최대 날짜커스텀 설정
 
$('#ID').datepicker({
          maxDate: 설정날짜,
          minDate: 설정짜
    });
cs