-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2049 from VisActor/release/1.5.0
[Auto release] release 1.5.0
- Loading branch information
Showing
129 changed files
with
2,200 additions
and
1,507 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1 +1 @@ | ||
[{"definitionName":"lockStepVersion","policyName":"vtableMain","version":"1.4.2","mainProject":"@visactor/vtable","nextBump":"patch"}] | ||
[{"definitionName":"lockStepVersion","policyName":"vtableMain","version":"1.5.0","mainProject":"@visactor/vtable","nextBump":"minor"}] |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
--- | ||
category: examples | ||
group: Basic Features | ||
title: Freeze Row | ||
cover: https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/VTable/preview/frozen-row.gif | ||
link: '../guide/basic_function/frozen_column_row' | ||
option: ListTable#frozenRowCount | ||
--- | ||
|
||
# Freeze Row | ||
|
||
In order to keep these key information rows visible throughout the horizontal scroll, we need to "freeze" these rows. | ||
|
||
## Key Configurations | ||
|
||
- `frozenRowCount` The number of frozen rows (including header), default is the number of header rows | ||
|
||
## Code demo | ||
|
||
```javascript livedemo template=vtable | ||
|
||
let tableInstance; | ||
fetch('https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/VTable/North_American_Superstore_Pivot_data.json') | ||
.then(res => res.json()) | ||
.then(data => { | ||
const option = { | ||
records: data, | ||
rows: [ | ||
{ | ||
dimensionKey: 'City', | ||
title: 'City', | ||
headerStyle: { | ||
textStick: true, | ||
color: (args) => { | ||
if (args.row < 4) { | ||
return 'red'; | ||
} | ||
return '#000'; | ||
}, | ||
bgColor: (args) => { | ||
if (args.row < 4) { | ||
return 'rgba(255, 0, 0, 0.1)'; | ||
} | ||
return '#fff'; | ||
} | ||
}, | ||
width: 'auto' | ||
} | ||
], | ||
columns: [ | ||
{ | ||
dimensionKey: 'Category', | ||
title: 'Category', | ||
headerStyle: { | ||
textStick: true | ||
}, | ||
width: 'auto' | ||
} | ||
], | ||
indicators: [ | ||
{ | ||
indicatorKey: 'Quantity', | ||
title: 'Quantity', | ||
width: 'auto', | ||
showSort: false, | ||
headerStyle: { | ||
fontWeight: 'normal' | ||
}, | ||
style: { | ||
padding: [16, 28, 16, 28], | ||
color(args) { | ||
if (args.dataValue >= 0) return 'black'; | ||
return 'red'; | ||
}, | ||
bgColor: (args) => { | ||
if (args.row < 4) { | ||
return 'rgba(255, 0, 0, 0.1)'; | ||
} | ||
return '#fff'; | ||
} | ||
} | ||
}, | ||
{ | ||
indicatorKey: 'Sales', | ||
title: 'Sales', | ||
width: 'auto', | ||
showSort: false, | ||
headerStyle: { | ||
fontWeight: 'normal' | ||
}, | ||
format: rec => { | ||
return '$' + Number(rec).toFixed(2); | ||
}, | ||
style: { | ||
padding: [16, 28, 16, 28], | ||
color(args) { | ||
if (args.dataValue >= 0) return 'black'; | ||
return 'red'; | ||
}, | ||
bgColor: (args) => { | ||
if (args.row < 4) { | ||
return 'rgba(255, 0, 0, 0.1)'; | ||
} | ||
return '#fff'; | ||
} | ||
} | ||
}, | ||
{ | ||
indicatorKey: 'Profit', | ||
title: 'Profit', | ||
width: 'auto', | ||
showSort: false, | ||
headerStyle: { | ||
fontWeight: 'normal' | ||
}, | ||
format: rec => { | ||
return '$' + Number(rec).toFixed(2); | ||
}, | ||
style: { | ||
padding: [16, 28, 16, 28], | ||
color(args) { | ||
if (args.dataValue >= 0) return 'black'; | ||
return 'red'; | ||
}, | ||
bgColor: (args) => { | ||
if (args.row < 4) { | ||
return 'rgba(255, 0, 0, 0.1)'; | ||
} | ||
return '#fff'; | ||
} | ||
} | ||
} | ||
], | ||
corner: { | ||
titleOnDimension: 'row', | ||
headerStyle: { | ||
textStick: true | ||
} | ||
}, | ||
dataConfig: { | ||
sortRules: [ | ||
{ | ||
sortField: 'Category', | ||
sortBy: ['Office Supplies', 'Technology', 'Furniture'] | ||
} | ||
] | ||
}, | ||
widthMode: 'standard', | ||
frozenRowCount: 4, | ||
}; | ||
tableInstance = new VTable.PivotTable(document.getElementById(CONTAINER_ID), option); | ||
window['tableInstance'] = tableInstance; | ||
}); | ||
``` |
Oops, something went wrong.