Skip to content

Commit

Permalink
#534 schema browser sorting order update
Browse files Browse the repository at this point in the history
  • Loading branch information
sting009 committed Nov 8, 2018
1 parent 1d9bb87 commit efcb737
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
22 changes: 22 additions & 0 deletions discovery-frontend/src/app/common/component/grid/grid.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,28 @@ export class GridComponent implements AfterViewInit, OnDestroy {
fnScope.grid.setSelectedRows(selectedRows);
} // function - selectRowActivate


/**
* 현재의 sort column 상태 변경
* @param isAsc - ASC : true, DESC : false
* @param scope
*/
public setCurrentSortColumns(isAsc : boolean, scope: any = null,): void {

const fnScope: any = scope === null ? this : scope;
let arr = [];
const columnsList = fnScope.grid.getColumns();
for (let index: number = 0; index < columnsList.length; index++) {
let obj = {
columnId : columnsList[index]['id'],
sortAsc : isAsc
};
arr.push(obj);
}
fnScope.grid.setSortColumns(arr, isAsc);

} // function - setCurrentSortColumn

/**
* 컬럼 선택 해제
* @param {number | string} column
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1016,6 +1016,14 @@ export class DetailWorkbenchSchemaBrowserComponent extends AbstractWorkbenchComp

// 그리드 셀렉트 효과
this.gridSchemaComponent.selectRowActivate(0);
// 현재 상태를 sort asc 변경
this.gridSchemaComponent.setCurrentSortColumns(true);

for (let index: number = 0; index < headers.length; index++) {
// icon default 변경
const gridSchemaHeader = $('.ddp-pop-wrapList .slick-header-columns');
gridSchemaHeader.find('.slick-sort-indicator').eq(index).removeClass('slick-sort-indicator-asc');
}

}
}
Expand Down

0 comments on commit efcb737

Please sign in to comment.