ajax : { "url": contextPath + "/moveStatus/search", "type":"POST", data: { compName: document.getElementsByClassName('selectBoxStyle')[0].value, startDate: document.getElementById('startDate').value, endDate: document.getElementById('endDate').value, empName: document.getElementById('empName').value }, "dataSrc": function(json) { console.log(json); let data = new Object(); let jsonData = new Arr..
ajax : { "dataSrc": function(json) { console.log(json); let data = new Object(); let jsonData = new Array(); for(let i = 0; i < json.data.length; i++) { if( json.data[i].nextDeptName == ''){ console.log(json.data[i]); delete json.data[i]; } else { jsonData.push(json.data[i]); } } data.data = jsonData; console.log(data); return data; } } 마지막에 return을 해주지않으면 발생하는 에러 return 을 해주면 에러 해결