-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ee80fce
commit b2a4ee3
Showing
8 changed files
with
183 additions
and
13 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
src/app/demo/pc/table/auto-page-sizing/demo.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!-- ignore the following lines, they are not important to this demo --> | ||
<jigsaw-demo-description [summary]="summary" [content]="description"> | ||
</jigsaw-demo-description> | ||
|
||
|
||
<!-- start to learn the demo from here --> | ||
<div style="height: calc(100vh - 120px); margin-bottom: 10px;"> | ||
<jigsaw-table #tableCmp style="margin-bottom: 10px;" height="100%" [data]="pageable" [hideHeader]="hideHeader"></jigsaw-table> | ||
<div style="display: flex; align-items: center;"> | ||
<jigsaw-pagination [data]="pageable" [pageSizeOptions]="[5, 10, 20]"></jigsaw-pagination> | ||
<span>共{{pageable.pagingInfo.totalRecord}}条记录</span> | ||
<jigsaw-checkbox [(checked)]="pageable.pagingInfo.autoPageSizing" (checkedChange)="cdr.markForCheck()" | ||
style="margin-left: 20px"> | ||
单页记录数自适应屏幕高度 | ||
</jigsaw-checkbox> | ||
<jigsaw-checkbox [(checked)]="hideHeader" (checkedChange)="cdr.markForCheck()" | ||
style="margin-left: 20px"> | ||
隐藏表头 | ||
</jigsaw-checkbox> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { Component, ViewChild, ChangeDetectorRef } from "@angular/core"; | ||
import { HttpClient } from "@angular/common/http"; | ||
import { LocalPageableTableData, JigsawTable } from "jigsaw/public_api"; | ||
|
||
@Component({ | ||
templateUrl: './demo.component.html' | ||
}) | ||
export class TableAutoPageableDemoComponent { | ||
@ViewChild('tableCmp') | ||
tableCmp: JigsawTable; | ||
pageable: LocalPageableTableData; | ||
hideHeader: boolean = false; | ||
|
||
constructor(http: HttpClient, public cdr: ChangeDetectorRef) { | ||
this.pageable = new LocalPageableTableData(); | ||
this.pageable.http = http; | ||
this.pageable.fromAjax('mock-data/hr-list'); | ||
this.pageable.pagingInfo.autoPageSizing = true; | ||
this.pageable.pagingInfo.itemHeight = 30; | ||
} | ||
|
||
// ==================================================================== | ||
// ignore the following lines, they are not important to this demo | ||
// ==================================================================== | ||
summary: string = '此demo展示了根据容器高度来自动设置分页页数的功能,目前仅支持表格所有记录都等高的情况。'; | ||
description: string = '提示:在表格的`columnDefines`属性里添加一个cell.tooltip属性可以让对应的列保持不换行,' + | ||
'避免表格中某些行文本过多导致的意外换行,从而造成自动计算的当前也条数错误的问题,参考[这个demo](#/pc/table/renderer)的源码。'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import {NgModule} from '@angular/core'; | ||
import {JigsawTableModule, JigsawPaginationModule, JigsawButtonBarModule, JigsawCheckBoxModule} from "jigsaw/public_api"; | ||
import {TableAutoPageableDemoComponent} from './demo.component'; | ||
import {JigsawDemoDescriptionModule} from "app/demo-description/demo-description"; | ||
|
||
@NgModule({ | ||
imports: [JigsawTableModule, JigsawPaginationModule, JigsawDemoDescriptionModule, JigsawButtonBarModule, JigsawCheckBoxModule], | ||
declarations: [TableAutoPageableDemoComponent], | ||
exports: [TableAutoPageableDemoComponent] | ||
}) | ||
export class TableAutoPageableDemoModule { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters