当前位置:网站首页>X-sheet development tutorial: initialization configuration custom layout
X-sheet development tutorial: initialization configuration custom layout
2022-07-27 17:51:00 【InfoQ】
Introduce
To configure
const settings = {
// Workbook configuration
workConfig: {
// Creation time
created: "",
// Modification time
modified: "",
// The author information
creator: "",
// Finally, modify the author
lastModifiedBy: "",
// Name of the workbook
name: "x-sheet",
// Top configuration
top: {
// Top options bar configuration
option: {
// Whether to display the option bar
show: true,
},
// Top menu bar configuration
menu: {
// Show menu bar or not
show: true,
},
},
// Main body configuration
body: {
// Worksheet menu configuration
sheetConfig: {
// Whether to display the right-click menu
showMenu: true,
},
// Worksheet body configuration
sheets: [
{
// Worksheet name
name: "sheet1",
// Table configuration
tableConfig: {
// Title row and column configuration
index: {
// Title row height
height: 30,
// Title column width
width: 50,
// Title row border color
gridColor: "rgb(193,193,193)",
// Font size of Title row and column
size: 12,
// Title line font color
color: "rgb(0,0,0)",
},
// The overall configuration of the table
table: {
// Show gridlines or not
showGrid: true,
// Table area background color
background: "rgb(255,255,255)",
// Grid line color
gridColor: "rgb(225,225,225)",
},
// Line configuration
rows: {
// Customize the maximum number of rows
len: 100,
// Default line height
height: 30,
// Row configuration data
data: [
{
// Custom line height , If it is not set, the default row height will be taken
height: 100
},
],
},
// Column configuration
cols: {
// Customize the maximum number of columns
len: 25,
// Default column width
width: 110,
// Row configuration data
data: [{
// Custom column width , If it is not set, the default column width will be taken
width: 200
}],
},
// Freezing range
xFixedView: {
// Freeze column index ,-1 For not freezing
fxLeft: -1,
// Freeze row index ,-1 For not freezing
fxTop: -1,
},
// Freeze split line style
xFixedBar: {
// Freeze row split line height
height: 16,
// Freeze column divider width
width: 26,
// Freeze the split line background color
background: "rgb(234,234,234)",
// Freeze split line button background color
buttonColor: "rgb(193,193,193)",
},
// Tabular data , Two dimensional array
data: [
[
// A1 Cell data
{
// Cell type
contentType: 2,
// Font properties
fontAttr: {
// Line break
textWrap: 2,
// Direction
direction: "vertical",
},
// Rich text configuration
richText: {
// Rich text specific field information
rich: [
// The first paragraph is rich text
{
// typeface
name: "Arial",
// font size
size: 14,
// Text content
text: " I am a ",
// The font color
color: "rgb(255,0,2)",
// Is it bold
bold: false,
// Is it italicized
italic: false,
// Whether there is a delete line
strikethrough: false,
// Is there an underline
underline: false,
},
{
// The second paragraph of rich text contains characters
// If no style is configured , Just take the style of the cell , Cells are not styled , Just take the default style
text: " Rich text ",
},
],
},
},
{
// The background color
background: "rgb(255,255,0)",
// Cell icon
icons: [],
// Custom properties
custom: {},
// Font measuring ruler
ruler: undefined,
// Format type
format: "default",
// Cell formula
formula: undefined,
// Text content
text: "Text",
// Formatted content
formatText: "Text",
// The width of the content
contentWidth: 100,
// The height of the content
contentHeight: 100,
// Font properties
fontAttr: {
// typeface
name: "Arial",
// font size
size: 14,
// The font color
color: "rgb(0,0,0)",
// Is it bold
bold: false,
// Is it italicized
italic: false,
// Whether there is a delete line
strikethrough: false,
// Is there an underline
underline: false,
// padding
padding: 5,
// Text angle
angle: 0,
// The text direction
direction: "horizontal", // 'horizontal' 'vertical' 'angle' 'bar'
// Horizontal alignment
align: "left", // 'left' 'center' 'right'
// Vertical alignment
verticalAlign: "middle", // 'top' 'middle' 'bottom'
// Word wrap
textWrap: 1, // 1 overflow 2 Line break 3 truncation
},
// Border properties
borderAttr: {
// The left margin
left: {
// Hierarchy
zIndex: 0,
// Whether or not shown
display: true,
// Width type
widthType: "low", // 'low' 'medium' 'high'
// Color
color: "rgb(0,0,0)",
// Line type
type: 0, // 0 solid 1 dotted 2 point 3 double
},
// Right margin
right: {
zIndex: 0,
display: true,
widthType: "medium",
color: "rgb(0,255,0)",
type: 0,
},
// On the border
top: {
zIndex: 0,
display: false,
widthType: "high",
color: "rgb(0,0,255)",
type: 0,
},
// Under the frame
bottom: {
zIndex: 0,
display: true,
widthType: "high",
color: "rgb(0,255,255)",
type: 3,
},
},
},
],
],
// Protection configuration
protection: {
protections: [],
},
// Whether to protect
sheetProtection: true,
// merge cell
merge: { merges: ["A2:B3", "D5:H9"] },
},
},
],
// Worksheet tab configuration
tabConfig: {
// Whether to display the tab right-click menu
showMenu: true,
},
},
// Bottom status bar configuration
bottom: {
// Is the status bar displayed
show: true,
},
},
};
// initialization x-sheet
new XSheet("#demo1", settings);
summary
Reference resources
- X-Sheet Development tutorial : Initialize configuration custom layout
- High performance web javaScript The spreadsheet
- Free and open source high performance JavaScript The spreadsheet :X-Sheet Entry experience
边栏推荐
猜你喜欢

The chess robot broke the finger of a 7-year-old boy. Netizen: it violated the first law of robots

C语言怎么学?这篇文章给你完整答案

MLX90640 红外热成像仪测温传感器模块开发笔记(七)

Technical practice dry goods | from workflow to workflow

20年前,他是马云最大的敌人

阿里巴巴鹰眼系统简介

The 7-year-old boy broke his finger by AI robot just because he played chess too fast?

Introduction to Alibaba eagle eye system

Oracle 11g数据库安装教程

面试好难啊!蚂蚁金服的六轮面试我是强撑过来!差点OUT(面试复盘)
随机推荐
Use @ in the project created by CRA, let it recognize the @ path and give path tips
Subject 3: straight driving
wallys/DR882-Qualcomm-Atheros-QCA9882-2T2R-MIMO-802.11ac-Mini-PCIe-Wi-Fi-Module-5G-high-power.
Initial polymorphism
Smart fish tank design based on stm32
【数据库系统概论(王珊)】第4章——数据库安全性
What should we pay attention to when choosing the LED display screen of the stadium
写好技术原创文章的一点建议
诸神黄昏,“猫抖快”告别大V时代
Run loam_ Velodyne real-time mapping
公网域名如何解析到内网IP服务器——快解析域名映射外网访问
微信小程序 云函数批量删除多条数据 Error: errCode: -502005 database collection not exists
【单片机】2.2 AT89S52的引脚功能
二舅的外甥和他的学生们
Explain the pile of binary trees in detail
Introduction to Alibaba eagle eye system
每条你收藏的资讯背后,都离不开TA
后台管理系统 权限设置大致流程
【obs】x264_ encoder_ Encode encoding output PTS DTS and framesize
(2) CBAM integrated two stream project construction - data preparation