| | |
| | | config : function () { |
| | | var tableConfig = { |
| | | hName : "", // 헤더 이름 |
| | | hWidth : "", // 칼럼 길이 |
| | | hChecked : false, // 체크 박스 선택 여부 |
| | | hAlign : "text-center", // 헤더 정렬 기준 |
| | | hSort : true, // 정렬 가능 여부 |
| | | dName : "", // 데이터 이름 |
| | | dAlign : "text-left", // 데이터 정렬 기준 |
| | | dRenderer : "", // 렌더러 여부 |
| | | dVisible : "", // bootstrap 반응형 컬럼 표시 여부 |
| | | dType : "none", // 태그 타입 |
| | | dDateFormat : "", // 날짜 형식 |
| | | rowSpan : 0, // rowspan 을 지원한다. |
| | | colSpan : 0, // colspan 을 지원한다. |
| | | subHead : false, // 만약 rowspan, colspan 을 사용하게 되면 true 로 셋팅. |
| | | columnHint : "", // 컬럼 정보를 추출하기 위한 힌트 정보를 준다 - tableColumnGenerator 의 사용자 정의 필드 부분에서 사용 |
| | | setHName : function (hName) { |
| | | this.hName = hName; |
| | | return this; |
| | | }, |
| | | setHWidth : function (hWidth) { |
| | | this.hWidth = hWidth; |
| | | return this; |
| | | }, |
| | | setHChecked : function (hChecked) { |
| | | this.hChecked = hChecked; |
| | | return this; |
| | | }, |
| | | setHAlign : function (hAlign) { |
| | | this.hAlign = hAlign; |
| | | return this; |
| | | }, |
| | | setHSort : function (hSort) { |
| | | this.hSort = hSort; |
| | | return this; |
| | | }, |
| | | setDName : function (dName) { |
| | | this.dName = dName; |
| | | return this; |
| | | }, |
| | | setDAlign : function (dAlign) { |
| | | this.dAlign = dAlign; |
| | | return this; |
| | | }, |
| | | setDRenderer : function (dRenderer) { |
| | | this.dRenderer = dRenderer; |
| | | return this; |
| | | }, |
| | | setDVisible : function (dVisible) { |
| | |
| | | this.dDateFormat = dDateFormat; |
| | | return this; |
| | | }, |
| | | setRowSpan : function (dRowSpan) { |
| | | this.rowSpan = dRowSpan; |
| | | return this; |
| | | }, |
| | | setColSpan : function (dColSpan) { |
| | | this.colSpan = dColSpan; |
| | | return this; |
| | | }, |
| | | setSubHead : function (dSubHead) { |
| | | this.subHead = dSubHead; |
| | | return this; |
| | |
| | | }; |
| | | |
| | | return tableConfig; |
| | | }, |
| | | toggleChecked : function (checkStatus, datas) { |
| | | // 전체 선택 체크 박스를 클릭했을 경우 |
| | | angular.forEach(datas, function (data) { |
| | | if (angular.isDefined(data.defaultYn)) { |
| | | if (!data.defaultYn) { |
| | | data.checked = checkStatus; |
| | | } |
| | | } |
| | | else { |
| | | data.checked = checkStatus; |
| | | } |
| | | }); |
| | | }, |
| | | radioChecked : function (target, datas) { |
| | | // 해당 row 가 라디오 버튼일 경우 |
| | | angular.forEach(datas, function (data) { |
| | | if (target.id == data.id) { |
| | | data.checked = true; |
| | | } |
| | | else { |
| | | data.checked = false; |
| | | } |
| | | }); |
| | | }, |
| | | rowChecked : function (tableConfig, target, datas) { |
| | | // 각 row 의 체크박스/라디오 버튼을 클릭했을 경우 |
| | | if (tableConfig[0].dType == "checkbox") { |
| | | target.checked = !target.checked; |
| | | |
| | | for (var data in datas) { |
| | | if (!data.checked) { |
| | | this.hChecked = false; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | else if (tableConfig[0].dType == "radio") { |
| | | this.radioChecked(target, datas); |
| | | } |
| | | }, |
| | | orderByColumn : "", // table order By column name |
| | | reverse : true, |