Configure the address of `updateUrl`, Luckysheet will request the table data through ajax. By default, all `data` in the sheet data with status 1 is loaded, and the rest of the sheet loads all fields except the `data` field.
- Usage:Worksheet color, there will be a bottom border under the worksheet name
------------
## index
- Type:Number
- Default:0
- Usage:Worksheet index, starting from 0
------------
## status
- Type:Number
- Default:1
- Usage: Active state, there is only one active worksheet, other worksheets are 0
------------
## order
- Type:Number
- Default:0
- Usage: The order of the worksheets, it will increase when a worksheet is added, starting from 0
------------
## hide
- Type:Number
- Default:0
- Usage: Whether to hide, `0` means not to hide, `1` means to hide
------------
## column
- Type:Number
- Default:18
- Usage: Number of cell columns
------------
## row
- Type:Number
- Default:36
- Usage: Number of cell rows
------------
## visibledatarow
- Type:Number
- Default:[]
- Usage: Position information of all rows, incremental row position data
------------
## visibledatacolumn
- Type:Number
- Default:[]
- Usage: Position information of all columns, incremental column position data
------------
## ch_width
- Type:Number
- Default:2322
- Usage:The width of the entire worksheet area (the gray area including the border)
------------
## rh_height
- Type:Number
- Default:2322
- Usage:The height of the entire worksheet area (the gray area containing the border)
------------
## scrollLeft
- Type:Number
- Default:0
- Usage: Left and right scroll bar position
------------
## scrollTop
- Type:Number
- Default:0
- Usage: Up and down scroll bar position
------------
## config
- Type: Object
- Default: {}
- Usage: Table row height, column width, merged cells, borders, hidden rows and other settings
### config.merge
- Type:Object
- Default:{}
- Usage:Merge cell settings, example:
```js
{
"13_5": {
"r": 13,
"c": 5,
"rs": 3,
"cs": 1
},
"13_7": {
"r": 13,
"c": 7,
"rs": 3,
"cs": 2
},
"14_2": {
"r": 14,
"c": 2,
"rs": 1,
"cs": 2
}
}
```
The `key` in the object is the spliced value of `r +'_' + c`, and the `value` is the cell information in the upper left corner: r: number of rows, c: number of columns, rs: number of merged rows, cs: merge Number of columns
+ Border color `value.l.color: Hexadecimal color value`
- 示例
+ ```js
{
"rangeType": "range",
"borderType": "border-all",
"style": "3",
"color": "#0000ff",
"range": [{
"row": [7, 8],
"column": [2, 3]
}]
}
```
Represents a selection with a setting range of `{"row": [7, 8], "column": [2, 3]}`, the type is all borders, the border thickness is `Dotted`, and the color is `"#0000ff"`
+ ```js
{
"rangeType": "cell",
"value": {
"row_index": 3,
"col_index": 3,
"l": {
"style": 10,
"color": "rgb(255, 0, 0)"
},
"r": {
"style": 10,
"color": "rgb(255, 0, 0)"
},
"t": {
"style": 10,
"color": "rgb(255, 0, 0)"
},
"b": {
"style": 10,
"color": "rgb(255, 0, 0)"
}
}
}
```
Means to set the cell `"D4"`, the upper border/lower border/left border/right border are all border thicknesses `"MediumDashDot"`, color is `"rgb(255, 0, 0)"`
- Usage: The original cell data set is a set containing `{r:0,c:0,v:{m:"value",v:"value",ct: {fa: "General", t: "g"}} }`The one-dimensional array of format cell information is only used during initialization. After the table is initialized with celldata, the data is converted to the same level field data in the luckysheetfile, such as `luckysheetfile[0].data`, the subsequent operation of the table Data update will be updated to this data field, and celldata is no longer used. Example:
Configure the address of `loadSheetUrl`, the parameters are `gridKey` (table primary key) and `index` (sheet primary key collection, format is `[1,2,3]`), the returned data is the `data` field set of sheet
`r` stands for row, `c` stands for column, and `v` stands for the value of the cell. The value can be a character, number, or json string.
The data will only be loaded once, generally speaking, there is only one primary key, but considering that some formulas, charts and pivot tables will refer to the data of other sheets, the front desk will add a judgment, if the current sheet refers to the data of other sheets, then complete the data of the referenced sheet together.
Configure the address of `loadCellUrl`, the parameters are `gridKey` (table primary key), `index` (sheet primary key), start row, end row, start column, end column. The backend gets the specified celldata data according to the range and returns it.
| compress | Luckysheet uses client pako for zlib parameter compression, which is true if the browser supports compression, otherwise false. The backend can decide whether to decompress the data content based on this parameter | The process of obtaining parameters on the server side: 1. Serialize json string 2. Decode the data field if the compress field is TRUE 3. Decode the data string URLDecoder.decode(utf-8) |
| gridKey | Luckysheet file identifier | none |
| data | An array containing updated data. For the parameter format in the array, please see the introduction below. In the example: `t` indicates the update type, `i` is the index of the sheet, `c` is the row number, `r` is the column number, and `v` is the value | `data: [{ t : 'cell', i:0, c : 0, r : 0 , v: 2 }]` |