Browse Source

exportToExcel 함수에 columnKeys 파라미터 추가

gagamel 5 năm trước cách đây
mục cha
commit
3fb94da6cd

+ 5 - 3
style24.admin/src/main/webapp/ux/plugins/gaga/gaga.agGrid.js

@@ -1666,21 +1666,23 @@ var gagaAgGrid = {
 	/**
 	 * 그리드 데이터를 엑셀로 내보내기
 	 * <pre>
-	 * 		gagaAgGrid.exportToExcel('주문목록', gridOptionsOrderList, columnDefs);
+	 * 		gagaAgGrid.exportToExcel('주문목록', gridOptionsOrderList, columnKeys);
 	 * 		or
-	 * 		gagaAgGrid.exportToExcel('주문목록', gridOptionsOrderList, columnDefs, true);
+	 * 		gagaAgGrid.exportToExcel('주문목록', gridOptionsOrderList, columnKeys, true);
 	 * </pre>
 	 * @param title - 엑셀의 타이틀
 	 * @param gridOptions - Grid options
-	 * @param columnDefs - Column definitions
+	 * @param columnKeys - Column keys (출력하고자 하는 칼럼 정의)
 	 * @param isSelected - true/false
 	 * @author gagamel
 	 * @since 2019. 6. 7
 	 */
 	exportToExcel  : function(title, gridOptions, isSelected) {
+		var sColumnKeys = (typeof(columnKeys) == 'undefined') ? [] : columnKeys;
 		var bOnlySelected = (typeof(isSelected) == 'undefined') ? false : isSelected;
 
 		var params = {
+			columnKeys: sColumnKeys,
 			onlySelected: bOnlySelected, // true: Only export selected rows
 			fileName : title + "_" + new Date().format("YYYYMMDDHHmmss"),
 			sheetName: "DATA"/* ,