그런 경우 그리드의 scrollable = 'scrollable'속성을 설정하고 gridContent를 overflow-y auto로 설정해야합니다. 아래와 같이 HTML에서
.k-grid-content {
height: inherit;
overflow-y: auto;
}
설정 그리드 :
<kendo-grid id="grdView"
[ngStyle]="setStyles()"
[data]="yourDatabse"
[scrollable]="'scrollable'"
[height]="gridNewHeight"
>
그런 다음 아래와 같은 백엔드에서 설정 gridContent 높이 후 :
let height:number=300;
public setStyles(): any {
this.gridNewHeight = this.height;
let styles = {
'height': (this.gridNewHeight - 45) + 'px'
};
let gridHeaderHeight: number =40;
let gridContent: any = this.el.nativeElement.getElementsByClassName('k-grid-content')[0];
if (gridContent != null) {
gridContent.style.height = (this.gridNewHeight - (gridHeaderHeight)) + 'px';
}
return styles;
}
당신이 setStyles 내부의 코드를 설명 할 수 있다면 도움이 될 것이다 () 메소드를 사용하고 컨텐츠 영역 높이를 설정하는 이유는 –
입니다. 왜냐하면 우리는 컨텐츠 전체가 아닌 전체 그리드의 높이만 설정하기 때문입니다 –