产品一张表luckysheet前端代码库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

126 lines
4.1 KiB

5 years ago
# Advanced Features
5 years ago
## luckysheet.getcellvalue(r, c, data, type)
5 years ago
- **Parameter**:
- r: the number of rows in which the cell is located; optional values; integers starting at 0, 0 representing the first row.
- c: the number of columns in which the cell is located; optional values; integers starting at 0, 0 indicating the first column.
- data: table data; two-dimensional array; the default value is the current table data.
- type: cell attribute value; optional value; the default value is'v', which means to get the cell value.
- **Usage**:
5 years ago
5 years ago
This method is to get the cell value. When `r` and `c` have no value, return `data`; when `r`, `c` has only one value, return the entire row or column of data;
5 years ago
------------
## luckysheet.getluckysheetfile()
5 years ago
- **Usage**:
5 years ago
5 years ago
Return all table data structures.
5 years ago
------------
## luckysheet.sheetmanage.getSheetByIndex(index)
5 years ago
- **Parameter**:
- index: table subscript; integer starting from 0, 0 means the first table; default is the current table subscript.
- **Usage**:
5 years ago
5 years ago
Returns a table data structure.
5 years ago
------------
## luckysheet.getconfig()
5 years ago
- **Usage**:
5 years ago
5 years ago
Returns the current table configuration.
5 years ago
------------
## luckysheet.getSheetConfig(sheetIndex)
5 years ago
- **Parameter**:
- sheetIndex: table index; an integer starting from 0, 0 means the first table; the default is the current table index.
- **Usage**:
5 years ago
5 years ago
Return to a table configuration.
5 years ago
------------
## luckysheet.getvisibledatarow()
5 years ago
- **Usage**:
5 years ago
5 years ago
Returns the current table row height.
5 years ago
------------
## luckysheet.getvisibledatacolumn()
5 years ago
- **Usage**:
5 years ago
5 years ago
Returns the current table column width.
5 years ago
------------
## luckysheet.getluckysheet_select_save()
5 years ago
- **Usage**:
5 years ago
5 years ago
Returns the current selection.
5 years ago
------------
## luckysheet.getdatabyselection(range, sheetIndex)
5 years ago
- **Parameter**:
- range: selection object; `object: {row: [r1, r2], column: [c1, c2] }`; the default is the current selection.
- sheetIndex: table index; an integer starting from 0, 0 means the first table; the default is the current table index.
- **Usage**:
5 years ago
5 years ago
Returns the cell data of a range in a table.
5 years ago
------------
## luckysheet.luckysheetrefreshgrid(scrollWidth, scrollHeight)
5 years ago
- **Parameter**:
- scrollWidth: horizontal scroll value. The default is the current horizontal scroll position.
- scrollHeight: vertical scroll value. The default is the current vertical scroll position.
- **Usage**:
5 years ago
5 years ago
Refresh canvas display data according to scrollWidth, scrollHeight.
5 years ago
------------
## luckysheet.setcellvalue(r, c, d, v)
5 years ago
- **Parameter**:
- r: the number of rows in which the cell is located; an integer starting from 0, 0 means the first row.
- c: the number of columns in which the cell is located; an integer starting from 0, 0 means the first column.
- d: table data; two-dimensional array.
- v: The value to be set; it can be an object, and the object should conform to the cell object format.
- **Usage**:
Set the value of a cell. Cooperate with `luckysheet.luckysheetrefreshgrid()` to refresh to see the cell value changes.
5 years ago
```js
luckysheet.setcellvalue(0, 0, luckysheet.flowdata, 'abc');
luckysheet.luckysheetrefreshgrid();
```
------------
## luckysheet.setluckysheet_select_save(v)
5 years ago
- **Parameter**:
- v: The selection value (array) to be set. It conforms to the selection format rules, such as `[{ row: [r1, r2], column: [c1, c2] }]`.
- **Usage**:
5 years ago
5 years ago
Set the value of the current table selection. With `luckysheet.selectHightlightShow()`, you can view the selection changes on the interface.
5 years ago
```js
luckysheet.setluckysheet_select_save([{ row: [0, 1], column: [0, 1] }]);
luckysheet.selectHightlightShow();
```
------------
## luckysheet.sheetmanage.setSheetHide(index)
5 years ago
- **Parameter**:
- index: table subscript; integer starting from 0, 0 means the first table; default is the current table subscript.
- **Usage**:
5 years ago
5 years ago
Hide a table.
5 years ago
------------
## luckysheet.sheetmanage.setSheetShow(index)
5 years ago
- **Parameter**:
- index: table subscript; integer starting from 0, 0 means the first table; default is the current table subscript.
- **Usage**:
5 years ago
5 years ago
Display a table.
5 years ago
------------
## luckysheet.method.destroy()
5 years ago
- **Usage**:
5 years ago
5 years ago
Release table