공지사항 수정기능 추가.

강석 최 2022-09-20 15:05:16 +09:00
parent b2c5178aa7
commit 6dc6047556
2 changed files with 9 additions and 3 deletions

View File

@ -11,5 +11,10 @@ $(document).on('click', '.planTr', function (){
}) })
$(document).on('click', '#saveBtn', function (){ $(document).on('click', '#saveBtn', function (){
savePublicBoard("noticeEditForm") savePublicBoard("noticeEditForm", "PLB001")
})
$(document).on('click', '#editBtn', function (){
$("#viewModal").modal('hide')
getEditModal($("#viewModalPublicKey").val(), "PLB001")
}) })

View File

@ -64,6 +64,7 @@ $(document).on('click', '.deleteCommentBtn', function (){
} }
}) })
}) })
function getEditModal(publicKey, publicType){ function getEditModal(publicKey, publicType){
$.ajax({ $.ajax({
url: '/publicBoard/editModal', url: '/publicBoard/editModal',
@ -121,7 +122,7 @@ function getViewModal(publicKey, publicType){
}); });
} }
function savePublicBoard(formId){ function savePublicBoard(formId, publicType){
if(contentCheck(formId)){ if(contentCheck(formId)){
if(confirm("저장하시겠습니까?")){ if(confirm("저장하시겠습니까?")){
contentFade("in"); contentFade("in");
@ -143,7 +144,7 @@ function savePublicBoard(formId){
alert("저장되었습니다."); alert("저장되었습니다.");
contentFade("out"); contentFade("out");
$("#editModal").modal('hide'); $("#editModal").modal('hide');
getViewModal(result, 'PLB001'); getViewModal(result, publicType);
}, },
error : function(xhr, status) { error : function(xhr, status) {
alert("저장에 실패하였습니다.") alert("저장에 실패하였습니다.")