mirror of
https://github.com/VisActor/VTable
synced 2024-11-22 10:03:28 +00:00
Update scroll.md
This commit is contained in:
parent
09a948767c
commit
eaad880bc3
@ -21,8 +21,72 @@ VTable provides rich scroll style configuration items, and users can customize t
|
||||
Below we show the effect of these configurations with an example:
|
||||
|
||||
```javascript livedemo template=vtable
|
||||
const table =new VTable.ListTable(
|
||||
...
|
||||
let tableInstance;
|
||||
fetch('https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/VTable/North_American_Superstore_data.json')
|
||||
.then((res) => res.json())
|
||||
.then((data) => {
|
||||
const columns =[
|
||||
{
|
||||
"field": "Order ID",
|
||||
"title": "Order ID",
|
||||
"width": "auto"
|
||||
},
|
||||
{
|
||||
"field": "Customer ID",
|
||||
"title": "Customer ID",
|
||||
"width": "auto"
|
||||
},
|
||||
{
|
||||
"field": "Product Name",
|
||||
"title": "Product Name",
|
||||
"width": "auto"
|
||||
},
|
||||
{
|
||||
"field": "Category",
|
||||
"title": "Category",
|
||||
"width": "auto"
|
||||
},
|
||||
{
|
||||
"field": "Sub-Category",
|
||||
"title": "Sub-Category",
|
||||
"width": "auto"
|
||||
},
|
||||
{
|
||||
"field": "Region",
|
||||
"title": "Region",
|
||||
"width": "auto"
|
||||
},
|
||||
{
|
||||
"field": "City",
|
||||
"title": "City",
|
||||
"width": "auto"
|
||||
},
|
||||
{
|
||||
"field": "Order Date",
|
||||
"title": "Order Date",
|
||||
"width": "auto"
|
||||
},
|
||||
{
|
||||
"field": "Quantity",
|
||||
"title": "Quantity",
|
||||
"width": "auto"
|
||||
},
|
||||
{
|
||||
"field": "Sales",
|
||||
"title": "Sales",
|
||||
"width": "auto"
|
||||
},
|
||||
{
|
||||
"field": "Profit",
|
||||
"title": "Profit",
|
||||
"width": "auto"
|
||||
}
|
||||
];
|
||||
|
||||
const option = {
|
||||
records:data,
|
||||
columns,
|
||||
widthMode:'standard',
|
||||
theme: {
|
||||
scrollStyle: {
|
||||
visible:'always',
|
||||
@ -31,7 +95,10 @@ const table =new VTable.ListTable(
|
||||
hoverOn:false
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
tableInstance = new VTable.ListTable(document.getElementById(CONTAINER_ID), option);
|
||||
window['tableInstance'] = tableInstance;
|
||||
})
|
||||
```
|
||||
|
||||
## Scroll horizontally
|
||||
|
Loading…
Reference in New Issue
Block a user