2017-04-17 3 views
0

이것은 알려진 문제인 것처럼 보입니다. 그러나 아직 해결 방법이없는 것으로 보입니다. 열 제목을 볼 수 있도록 각도 고정 테이블 머리글을 설치 한 후각도 재질 고정 테이블 머리글

컨트롤러 'mdtable'지시 'mdcolumn'에 필요한 찾을 수 없습니다 THEAD의 MD-머리 = ""MD-: 나는 <thead>에 수정 헤드 속성을 추가 할 때이 오류가 콘솔에 나타납니다 순서가 숨겨진; "

내가 ui-router 또는 ng-if와 관련이있는 것으로 보인다. 브라우저가 다시로드 될 때 내 첫 페이지에 대해 작동하지만 내 다른 페이지에서는 콘솔에서이 문제를 해결하십시오. 다음은 고정 헤더를 설치하는 데 사용 된 사이트입니다 : https://github.com/daniel-nagy/fixed-table-header

답변

0

나는 그것이 작동하지 않는다고 생각합니다. ng-if 또는 ui-view로 div를 감싸는 경우

0

같은 설정과 데이터 소스가없는 다른 테이블을 추가했습니다. CSS 스타일에서 새 테이블의 위치는 절대적으로 이며이 새로운 테이블이 스크롤바의 일부를 포함하기 때문에 빈 테이블도 추가됩니다. CSS :

.tables { 
height: inherit; 
position: relative; 
display: flex; 
width: 100%; 
} 
.table { 
overflow: auto; 
height: 100%; 
width: 100%; 
position: relative; 
} 
.full-width { 
width: 100%; 
} 
.header-table { 
position: relative; 
width: 100%; 
} 
.header { 
display: flex; 
flex-direction: row; 
position: absolute; 
width: 100%; 
    } 

html 코드 :

<div class="tables"> 
    <md-table 
    [dataSource]="dataSource" 
    class="table"> 
    //columns and header definitions. 
</md-table> 
<div class="header"> 
    <md-table #table 
    class="header-table"> 
    //the same definition for columns and header. 
    </md-table> 
    <div class="scroll-wrapper"></div>//div that covers the scrollbar. 
</div> 

image