| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- const Comment = {
- // 선택 삭제
- delete: function() {
- let $list = $('input[type="checkbox"].list-check-box:checked');
- if($list.length <= 0) {
- alert("삭제할 댓글을 선택해 주세요.");
- return false;
- }
- if(confirm("정말 삭제하시겠습니까?")) {
- let keys = [];
- $list.each(function(i, row) {
- keys.push(row.value);
- });
- $.ajax({
- url: (BASE_URL + "/account/comment/delete"),
- type: 'DELETE',
- dataType: 'JSON',
- data: {
- keys: keys,
- },
- success: function (res) {
- if (!res.success) {
- alert(res.message);
- }
- },
- error: function () {
- alert("잘못된 요청입니다.");
- }
- }).done(function() {
- location.reload();
- });
- }
- },
- // 목록 개수 조정
- setPerPage: function(e) {
- let form = document.getElementById("fAccountComment");
- form.elements["per_page"].value = e.target.value;
- form.submit();
- }
- }
- // 전체선택 갱신
- $(document).on('change', '#chkAll', function () {
- $('input[type="checkbox"].list-check-box').prop('checked', this.checked);
- });
- // 선택삭제
- $(document).on("click", "#btnAccountCommentDelete", function() {
- Comment.delete();
- });
- // 목록 보기 갯수
- $(document).on("change", "select#perPage", function (e) {
- Comment.setPerPage(e);
- });
|