Index: arms/js/reqReview.js =================================================================== diff -u -r429409733f2ed4d93d529f0b5c051df869a970e0 -r242feb3482479ed73a94589fc32c9b1a8b7d1717 --- arms/js/reqReview.js (.../reqReview.js) (revision 429409733f2ed4d93d529f0b5c051df869a970e0) +++ arms/js/reqReview.js (.../reqReview.js) (revision 242feb3482479ed73a94589fc32c9b1a8b7d1717) @@ -90,7 +90,17 @@ var jquerySelector = "#reqreview_table"; var ajaxUrl = "/auth-user/api/arms/reqReview/getMonitor_Without_Root.do?reviewer=" + userName + "&filter=All"; - var jsonRoot = "result"; + var jsonRoot = function(json) { + var returnArr = []; + if( isEmpty(json.result) ){ + console.log("data is empty"); + }else{ + for (var i = 0; i < json.result.length; i++) { + returnArr.push(json.result[i]); + } + } + return returnArr; + }; var isServerSide = true; reqStatusDataTable = dataTable_build(jquerySelector, ajaxUrl, jsonRoot, columnList, rowsGroupList, @@ -115,3 +125,89 @@ function dataTableDrawCallback(tableInfo) { $("#" + tableInfo.sInstance).DataTable().columns.adjust().responsive.recalc(); } + + +// side menu click +$("#review_classify").click(async function (ev) { + var li = ev.target.parentNode; + for (var item of ev.currentTarget.children) { + item.classList.remove("active"); + } + + li.classList.add("active"); + + + $('#reqreview_table').dataTable().empty(); + + var columnList = [ + { name: "c_id", + title: "ID", + data: "c_id", + visible: true + }, + { name: "c_review_pdservice_name", + title: "제품(서비스)", + data: "c_review_pdservice_name", + visible: true + }, + { name: "c_review_req_link", + title: "요구사항 아이디", + data: "c_review_req_link", + visible: false + }, + { name: "c_review_req_name", + title: "요구사항", + data: "c_review_req_name", + visible: true + }, + { name: "c_review_sender", + title: "리뷰 요청인", + data: "c_review_sender", + visible: true + }, + { name: "c_review_responder", + title: "리뷰 응답인", + data: "c_review_responder", + visible: true + }, + { name: "c_review_result_state", + title: "리뷰 상태", + data: "c_review_result_state", + visible: true + }, + { name: "c_review_creat_date", + title: "리뷰 생성일", + data: "c_review_creat_date", + visible: true + }, + + ]; + + var rowsGroupList = []; + var columnDefList = []; + var selectList = {}; + var orderList = [[ 1, 'asc' ]]; + var buttonList = []; + + var jquerySelector = "#reqreview_table"; + + var jsonRoot = function(json) { + var returnArr = []; + if( isEmpty(json.result) ){ + console.log("data is empty"); + }else{ + for (var i = 0; i < json.result.length; i++) { + returnArr.push(json.result[i]); + } + } + return returnArr; + }; + + var isServerSide = true; + + var ajaxUrl = "/auth-user/api/arms/reqReview/getMonitor_Without_Root.do?reviewer=" + userName + "&filter=" + li.dataset.c_review_result_state; + + reqStatusDataTable = dataTable_build(jquerySelector, ajaxUrl, jsonRoot, columnList, rowsGroupList, + columnDefList, selectList, orderList, buttonList, isServerSide); + +}); \ No newline at end of file