Luckysheet has opened up the main function API for common data operation requirements, and developers can do any docking development according to their needs.
Use note:
success
callback function is the return value of the API methodorder
parameter in the API method is the value of order
in the worksheet object, not index
Parameter:
v
or the display value m
; the default value is v
, which means to get the actual value of the cellExplanation:
Get the value of the cell.
In special cases, the cell format is yyyy-MM-dd
, when type
is 'v'
, the display value of 'm'
will be forced
Usage:
Returns the v value of the data in the first row and first column of the current worksheet
luckysheet.getCellValue(0, 0)
Returns the original value of the cell in the second row and second column of the specified data.
luckysheet.getCellValue(1, 1, {type:"m"})
Parameter:
true
; used to control throttling when multiple cells are assigned, the previous cell should be set to false
, and the last cell is set Is true
.Explanation:
Set the value of a cell, you can also set the entire cell object, which is used to set multiple cell properties at the same time.
If you need to update the formula, you can also assign a value here. Luckysheet will actively calculate this formula internally and add it to the formula chain, and finally refresh the interface.
Usage:
Set the value of cell "A1" in the current worksheet to "1"
luckysheet.setCellValue(0, 0, 1);
Set the current worksheet "B1" cell value to the formula "=sum(A1)"
luckysheet.setCellValue(0, 1, "=sum(A1)");
Set the cell "C1" of the current worksheet to the formula "=sum(A1:B1" with a red background. The cell object can have no v
and m
values. Luckysheet will automatically calculate the result according to the formula information. With v
and m
values that have not been updated or are non-formula results, Luckysheet will still calculate the prepared results based on the data actually associated with the formula.
luckysheet.setCellValue(0, 2, {f: "=sum(A1:B1)", bg:"#FF0000"})
Set the "C1" cell again and the new formula can still take effect
`luckysheet.setCellValue(0, 2, {f: "=sum(A1)", bg:"#00FF00"})`
Parameter:
Explanation:
Clear the contents of the specified cell of the specified worksheet, return the cleared data, which is different from the function of deleting the cell, no need to set the cell movement
Usage:
B2
luckysheet.clearCell(1,1)
Possible values of move
are:
+ `"left"`: Move the right cell to the left
+ `"up"`: Move the lower cell up
{PlainObject} [setting]: optional parameters
Explanation:
Delete the specified cell of the specified worksheet, return the deleted data, and at the same time, specify whether to move the right cell to the left or the bottom cell to move up
Usage:
luckysheet.deleteCell('left')
Parameter:
Attr
is the cell format ct
, then the setting value value
should provide a ct object, such as: {fa:"General", t:"g"}
, for example, set the format of cell A1 to percentage format:
luckysheet.setCellFormat(0, 0, "ct", {fa:"0.00%", t:"n"})
Explanation:
Set the properties of a cell. If you want to set the value of a cell or set multiple cell properties at the same time, it is recommended to use setCellValue
Special settings
When setting the border, attr is "bd"
, value is a key/value object, and the border type: borderType
/border thickness:style
/border color:color
need to be set at the same time, such as setting A1 unit The border of the grid is all/red/thin:
luckysheet.setCellFormat(0, 0, "bd", {borderType: "border-right",style: "1", color: "#ff0000"})
The complete optional setting parameters are as follows:
borderType: "border-left" | "border-right" | "border-top" | "border-bottom" | "border-all" | "border-outside" | "border-inside" | "border -horizontal" | "border-vertical" | "border-none"
,style: 1 Thin | 2 Hair | 3 Dotted | 4 Dashed | 5 DashDot | 6 DashDotDot | 7 Double | 8 Medium | 9 MediumDashed | 10 MediumDashDot | 11 MediumDashDotDot | 12 SlantedDashDot | 13 Thick
color: hexadecimal color value
Usage:
luckysheet.setCellFormat(0, 0, "bl", 1)
luckysheet.setCellFormat(1, 1, "bg", "#ff0000", {order:1})
luckysheet.setCellFormat(0, 0,'v','abc');
Parameter:
false
false
false
"m"
Explanation:
Find the specified content in a worksheet and return a one-bit array of cells composed of the found content, the data format is the same as celldata
.
Usage:
"value"
in the current worksheet
luckysheet.find("value")
"SUM"
luckysheet.find("SUM",{type:"f"})
Parameter:
false
false
false
Explanation:
Find the specified content in a worksheet and replace it with new content, and return a one-bit array of cells composed of the replaced content. The data format is the same as celldata
.
Usage:
"value"
in the current worksheet and replace it with "out"
luckysheet.replace("value", "out")
Parameter:
Explanation:
Exit edit mode. After double-clicking the cell with the mouse, it will enter the cell editing mode. After the editing is completed, when the mouse clicks on the input box elsewhere to lose focus, the editing mode will be exited, and the value of the cell will be saved. This Api is the operation of automatically exiting the editing mode, mainly to trigger the automatic saving of cells.
Usage:
luckysheet.exitEditMode()
Parameter:
{Boolean} [isRange]: Whether to freeze rows to selection
Possible values of isRange
are:
"false"
: Freeze the first line"true"
: freeze line to selection{PlainObject} [setting]: optional parameters
isRange
is true
, open the frozen cell position, the format is { row_focus:0, column_focus:0 }
, which means the currently activated cell The number of rows and columns of the grid; the default is obtained from the last selection of the current selectionExplanation:
Freeze row operation
Pay special attention to the setting of range
in setting
only when isRange
is set to true
, which is different from the general range format.
Usage:
Freeze the first row
luckysheet.setHorizontalFrozen(false)
Frozen to B5
selection
luckysheet.setHorizontalFrozen(true, { range: 'B5' })
Parameter:
{Boolean} [isRange]: Whether to freeze the selection
Possible values of isRange
are:
"false"
: Freeze the first column"true"
: Freeze column to selection{PlainObject} [setting]: optional parameters
isRange
is true
, open the frozen cell position, the format is { row_focus:0, column_focus:0 }
, which means the currently activated cell The number of rows and columns of the grid; the default is obtained from the last selection of the current selectionExplanation:
Freeze column operation
Pay special attention to the setting of range
in setting
only when isRange
is set to true
, which is different from the general range format.
Usage:
Freeze the first column
luckysheet.setVerticalFrozen(false)
Parameter:
{Boolean} [isRange]: Whether to freeze the ranks to the selection
Possible values of isRange
are:
"false"
: Freeze ranks"true"
: Freeze ranks to selection{PlainObject} [setting]: optional parameters
isRange
is true
, open the frozen cell position, the format is { row_focus:0, column_focus:0 }
, which means the currently activated cell The number of rows and columns of the grid; the default is obtained from the last selection of the current selectionExplanation:
Freeze rank operation
Pay special attention to the setting of range
in setting
only when isRange
is set to true
, which is different from the general range format.
If you want to use this API to set the freeze after the workbook is initialized, you can execute it in the hook function after the workbook is created, such as: ```js luckysheet.create({
hook:{
workbookCreateAfter:function(){
luckysheet.setBothFrozen(false);
}
}
});
Usage:
Frozen ranks
luckysheet.setBothFrozen(false)
Parameter:
Explanation:
Cancel freeze operation
Usage:
Cancel freeze
luckysheet.cancelFrozen()
Parameter:
{Number} [row]: Insert a blank row in the first few rows, starting from 0
{PlainObject} [setting]: optional parameters
Explanation:
Insert a blank line in the number
line at the position of the row
line
Usage:
Insert a blank line at the position of line 2
luckysheet.insertRow(1)
Parameter:
{Number} [column]: Insert a blank column in the first column
{PlainObject} [setting]: optional parameters
Explanation:
Insert a blank column in column number
at the position of column column
Usage:
Insert 3 blank rows in column 1
luckysheet.insertRow(0, { number: 3 })
Parameter:
{Number} [rowEnd]: the end row to be deleted
{PlainObject} [setting]: optional parameters
Explanation:
Delete the specified row
Special reminder, after deleting the row, the serial number of the row will not change, the following row will be added to the above, pay attention to observe whether the data is deleted correctly.
Usage:
Delete 2-4 lines
luckysheet.deleteRow(1, 3)
Parameter:
Explanation:
Delete the specified column
Special reminder, after deleting the column, the serial number of the column will not change, the right column will be added to the left, pay attention to whether the data is deleted correctly.
Usage:
Delete 2-4 columns
luckysheet.deleteColumn(1, 3)
Parameter:
Explanation:
Hide the specified row
Special reminder, after the row is hidden, the row number will change.
Usage:
Hide 2-4 rows
luckysheet.hideRow(1, 3)
Parameter:
{Number} [columnEnd]: the end column to be hidden
{PlainObject} [setting]: optional parameters
Explanation:
Hide the specified column
Special reminder, after hiding the column, the sequence number of the column will change.
Usage:
Hide 2-4 columns
luckysheet.hideColumn(1, 3)
Parameter:
Explanation:
Show the specified row
Usage:
Display 2-4 lines
luckysheet.showRow(1, 3)
Parameter:
Explanation:
Show the specified column
Usage:
Display 2-4 columns
luckysheet.showColumn(1, 3)
(TODO)
Parameter:
{Object} [rowInfo]: Correspondence between number of rows and height
{PlainObject} [setting]: optional parameters
Explanation:
Set the height of the specified row
Usage:
Set the height of the first row to 50px and the height of the second row to 60px
luckysheet.setRowHeight({0:50,1:60})
(TODO)
Parameter:
{Object} [columnInfo]: Correspondence between the number of columns and the width
{PlainObject} [setting]: optional parameters
Explanation:
Set the width of the specified column
Usage:
Set the width of the first column to 50px and the width of the second column to 60px
luckysheet.setColumnWidth({0:50,1:60})
(TODO)
Parameter:
{Array} [rowInfo]: The number of rows
{PlainObject} [setting]: optional parameters
Explanation:
Get the height of the specified row, get the object corresponding to the number of rows and height
Usage:
The height of the first row is 50px, the height of the second row is 60px, get these values
luckysheet.getRowHeight([0,1])
Return to get
{0:50,1:60}
(TODO)
Parameter:
{Array} [columnInfo]: The number of columns
{PlainObject} [setting]: optional parameters
Explanation:
Get the width of the specified column, get the object of the corresponding relationship between the number of columns and the width
Usage:
The width of the first column is 50px, the width of the second column is 60px, get these values
luckysheet.getColumnWidth([0,1])
Return to get
{0:50,1:60}
(TODO)
Parameter:
Explanation:
Get the default row height of the specified worksheet
Usage:
Returns the default row height of the current worksheet
luckysheet.getDefaultRowHeight()
Return to get
19
(TODO)
Parameter:
Explanation:
Get the default column width of the specified worksheet
Usage:
Returns the default column width of the current worksheet
luckysheet.getDefaultColWidth()
Return to get
73
Explanation:
Returns an array of current selection objects, there may be multiple selections. The format of each selection area is an object composed of row/column information {row:[0,1],column:[0,1]}
Usage:
The current selection is "A1:B2" and "B4:C5", execute
luckysheet.getRange()
The returned result is:
[
{ "row": [0,1], "column": [0,1] },
{ "row": [3,4], "column": [1,2] }
]
Explanation:
Returns an array representing the positions of all cells in the specified area, which is different from the getrange method, which organizes the data of the selection by cell (rather than a continuous area).
Usage:
Select the specified area in the table, and then execute
luckysheet.getRange()
The returned result is:
[
{"row":[0,0],"column":[0,2]},
{"row":[1,1],"column":[0,0]},
{"row":[3,3],"column":[0,0]}
]
Where,{"row":[0,0],"column":[0,2]} denote a whole continuous region.
Select the area above in the table and execute
luckysheet.getRangeWithFlatten()
The returned result is:
[
{"r":0,"c":0},
{"r":0,"c":1},
{"r":0,"c":2},
{"r":1,"c":0},
{"r":3,"c":0}
]
Explanation:
Returns an array of objects representing the contents of all cells in a specified range
Usage:
Select the specified area in the table, and then execute
luckysheet.getRange()
The returned result is:
[
{"row":[0,0],"column":[0,2]},
{"row":[1,1],"column":[0,0]},
{"row":[3,3],"column":[0,0]}
]
Where,{"row":[0,0],"column":[0,2]} denote a whole continuous region.
Select the area above in the table and execute
luckysheet.getRangeValuesWithFlatte()
The returned result is:
[
{
"bg": null,
"bl": 0,
"it": 0,
"ff": 0,
"fs": 11,
"fc": "rgb(51, 51, 51)",
"ht": 1,
"vt": 1,
"v": 1,
"ct": {
"fa": "General",
"t": "n"
},
"m": "1"
},
{
"bg": null,
"bl": 0,
"it": 0,
"ff": 0,
"fs": 11,
"fc": "rgb(51, 51, 51)",
"ht": 1,
"vt": 1,
"v": 2,
"ct": {
"fa": "General",
"t": "n"
},
"m": "2"
},
{
"bg": null,
"bl": 0,
"it": 0,
"ff": 0,
"fs": 11,
"fc": "rgb(51, 51, 51)",
"ht": 1,
"vt": 1,
"v": 3,
"ct": {
"fa": "General",
"t": "n"
},
"m": "3"
},
{
"v": "Background",
"ct": {
"fa": "General",
"t": "g"
},
"m": "Background",
"bg": null,
"bl": 1,
"it": 0,
"ff": 0,
"fs": 11,
"fc": "rgb(51, 51, 51)",
"ht": 1,
"vt": 1
},
{
"v": "Border",
"ct": {
"fa": "General",
"t": "g"
},
"m": "Border",
"bg": null,
"bl": 1,
"it": 0,
"ff": 0,
"fs": 11,
"fc": "rgb(51, 51, 51)",
"ht": 1,
"vt": 1
}
]
Explanation:
Returns an array of coordinate strings corresponding to the current selection. Multiple selections may exist. Each selection may be a single cell (such as A1) or a rectangular region of multiple cells (such as D9: E12)
Usage:
The current selection is"E10:E14"、"A7:B13"、"C4"、 "A3" and "C6:D9", execute
luckysheet.getRangeAxis()
The returned result is:
["E10:E14", "A7:B13", "C4", "A3", "C6:D9"]
Parameter:
"A1:B2"
, "sheetName!A1:B2"
or {row:[0,1],column:[0 ,1]}
, can only be a single selection; the default is the current selectionExplanation:
Returns the data of a two-dimensional array of cells in the specified range of the specified worksheet, each cell is an object.
Usage:
The current selection is "A1:B2", execute
luckysheet.getRangeValue()
The returned result is:
[
[
{
"v": "vaule1",
"ct": { "fa": "General", "t": "g" },
"m": "vaule1",
"bg": "rgba(255,255,255)",
"bl": 0,
"it": 0,
"ff": 1,
"fs": 11,
"fc": "rgb(51, 51, 51)",
"ht": 1,
"vt": 0
},
{
"v": "value3",
"ct": { "fa": "General", "t": "g" },
"m": "value3",
"bg": "rgba(255,255,255)",
"bl": 0,
"it": 0,
"ff": 1,
"fs": 11,
"fc": "rgb(51, 51, 51)",
"ht": 1,
"vt": 0
}
],
[
{
"v": "vaule2",
"ct": { "fa": "General", "t": "g" },
"m": "vaule2",
"bg": "rgba(255,255,255)",
"bl": 0,
"it": 0,
"ff": 1,
"fs": 11,
"fc": "rgb(51, 51, 51)",
"ht": 1,
"vt": 0
},
{
"v": "value4",
"ct": { "fa": "General", "t": "g" },
"m": "value4",
"bg": "rgba(255,255,255)",
"bl": 0,
"it": 0,
"ff": 1,
"fs": 11,
"fc": "rgb(51, 51, 51)",
"ht": 1,
"vt": 0
}
]
]
[todo]
Parameter:
"A1:B2"
, "sheetName!A1:B2"
or {row:[0,1],column: [0,1]}
, allows an array of multiple selections; the default is the current selectionExplanation:
Copy the data in the specified cell area of the specified worksheet and return the data containing the <table>
html format, which can be used to paste into excel to maintain the cell style.
Note that if you copy multiple selections, these selections must have the same row or the same column to copy, and the copied results will also be automatically merged into a concatenated array, for example, multiple selections "C18:C20"
/ "E18:E20"
/ "G18:H20"
is allowed, but multiple selections of "C18:C20"
/ "E18:E21"
are not allowed
Usage:
The current selection is "A1:B2", execute
luckysheet.getRangeHtml()
The returned result is:
<table data-type="luckysheet_copy_action_table">
<colgroup width="72px">
</colgroup>
<colgroup width="72px">
</colgroup>
<tr>
<td style="height:19px;">
value1
</td>
<td style="">
value3
</td>
</tr>
<tr>
<td style="height:19px;">
value2
</td>
<td style="">
value4
</td>
</tr>
</table>
Parameter:
{Boolean} [title]: Whether the first line is the title
Possible values of title
are:
"true"
: first row is title"false"
: The first row is not title{PlainObject} [setting]: optional parameters
"A1:B2"
, "sheetName!A1:B2"
or {row:[0,1],column: [0,1]}
, can only be a single selection; the default is the current selectionExplanation:
Copy the data in the specified cell area of the specified worksheet and return the data in json
format
Usage:
The current selection is "A1:B2", the first row is the title to get json
luckysheet.getRangeJson(true)
The returned result is:
[
{ "value1": "value2", "value3": "value4" }
]
The current selection is "A1:B2", the first row is not title to get json
luckysheet.getRangeJson(false)
The returned result is:
[
{ "A": "value1", "B": "value3" },
{ "A": "value2", "B": "value4" }
]
[todo]
Parameter:
{String} [dimensional]: array dimension
Possible values of dimensional
are:
"oneDimensional"
: one-dimensional array"twoDimensional"
: two-dimensional array"custom"
: a two-dimensional array of custom rows and columns{PlainObject} [setting]: optional parameters
dimensional
is custom
, the number of rows in the multidimensional arraydimensional
is custom
, the number of columns in the multidimensional array"A1:B2"
, "sheetName!A1:B2"
or {row:[0,1],column: [0,1]}
, can only be a single selection; the default is the current selectionExplanation:
Copy the data in the specified cell area of the specified worksheet, and return the data in a one-dimensional, two-dimensional, or two-dimensional array of custom rows and columns.
Pay special attention to the setting of row
and column
in setting
only when dimensional
is set to custom
Usage:
The current selection is "A1:B2", a one-dimensional array
luckysheet.getRangeArray('oneDimensional')
The returned result is:
["value1","value3","value2","value4"]
The current selection is "A1:B2", a two-dimensional array
luckysheet.getRangeArray('twoDimensional')
The returned result is:
[
[ "value1", "value3" ],
[ "value2", "value4" ]
]
The current selection area is "A1:C5", which is composed of values from'value1' to'value15', and obtains a two-dimensional array data with 3 rows and 2 columns
luckysheet.getRangeArray('custom', { row: 3, column: 2 })
The returned result is:
[
[
{
"m": "value1",
"ct": { "fa": "General", "t": "g" },
"v": "value1"
},
{
"ct": { "fa": "General", "t": "g" },
"v": "value6",
"m": "value6"
}
],
[
{
"ct": { "fa": "General", "t": "g" },
"v": "value11",
"m": "value11"
},
{
"m": "value2",
"ct": { "fa": "General", "t": "g" },
"v": "value2"
}
],
[
{
"ct": { "fa": "General", "t": "g" },
"v": "value7",
"m": "value7"
},
{
"ct": { "fa": "General", "t": "g" },
"v": "value12",
"m": "value12"
}
]
]
Parameter:
{String} [type]: diagonal or diagonal offset
Possible values of type
are:
"normal"
: diagonal"anti"
: anti-diagonal"offset"
: diagonal offset{PlainObject} [setting]: optional parameters
{Number} [column]: Set when type
is offset
, the number of columns for diagonal offset
"A1:B2"
, "sheetName!A1:B2"
or {row:[0,1],column: [0,1]}
, can only be a single selection; the default is the current selectionExplanation:
Copy the data in the specified cell area of the specified worksheet, and return the diagonal or diagonal offset data from the column
column.
Pay special attention to the setting of column
in setting
only when type
is set to offset
.
Usage:
The current selection is "A1:B2", diagonal
luckysheet.getRangeDiagonal('normal')
The returned result is:
[
{
"m": "value1",
"ct": { "fa": "General", "t": "g" },
"v": "value1"
},
{
"m": "value4",
"ct": { "fa": "General", "t": "g" },
"v": "value4"
}
]
The current selection is "A1:B2", against the diagonal
luckysheet.getRangeDiagonal('anti')
The returned result is:
[
{
"m": "value3",
"ct": { "fa": "General", "t": "g" },
"v": "value3"
},
{
"m": "value2",
"ct": { "fa": "General", "t": "g" },
"v": "value2"
}
]
The current selection is "A1:B2", and the diagonal is offset by 1 column
luckysheet.getRangeDiagonal('offset', { column: 1 })
The returned result is:
[
{
"m": "value3",
"ct": { "fa": "General", "t": "g" },
"v": "value3"
}
]
Parameter:
"A1:B2"
, "sheetName!A1:B2"
or {row:[0,1],column: [0,1]}
, can only be a single selection; the default is the current selectionExplanation:
Copy the data in the specified cell area of the specified worksheet, and return the data of Boolean value
Usage:
The current selection is "A1:B2"
luckysheet.getRangeBoolean()
The returned result is:
[
[ false, false ],
[ false, false ]
]
Parameter:
"A1:B2"
, "sheetName!A1:B2"
or {row:[0,1],column: [0,1]}
, allows an array of multiple selections; the default is the current selectiontrue
Explanation:
Specify one or more selection areas in the worksheet to be selected and choose whether to highlight or not. Multiple format settings are supported.
Special reminder, the selection range setting involved in Luckysheet can refer to this setting
Usage:
Set the current worksheet selection area A1:B2
:
luckysheet.setRangeShow("A1:B2")
Set selection range A1:B2
:
luckysheet.setRangeShow(["A1:B2"])
Set selection range A1:B2
:
luckysheet.setRangeShow({row:[0,1],column:[0,1]})
Set selection range A1:B2
:
luckysheet.setRangeShow([{row:[0,1],column:[0,1]}])
Set the selection range A1:B2
and C3:D4
:
luckysheet.setRangeShow(["A1:B2","C3:D4"])
Set the selection range A1:B2
and D3
:
luckysheet.setRangeShow([{row:[0,1],column:[0,1]},{row:[2,2],column:[3,3]}])
Parameter:
"A1:B2"
, "sheetName!A1:B2"
or {row:[0,1],column: [0,1]}
, can only be a single selection; the default is the current selectiontrue
; used to control throttling when multiple cells are assigned, the previous cell should be set to false
, and the last cell is set Is true
.Explanation:
Assign a cell array data to the specified area, the data format is the same as the data obtained by the getRangeValue
method.
Note that usually the getRangeValue
method only obtains the selection data, but does not include the border and merged cell information. When the setRangeValue
is executed, it will dynamically determine whether the previous step has executed the getRangeValue
, if executed, the border will be Obtained from Luckysheet configuration together with the merged cell information.
Usage:
Assign value to current selection
const data = [
[
{
"m": "value1",
"ct": {
"fa": "General",
"t": "g"
},
"v": "value1"
},
{
"m": "value3",
"ct": {
"fa": "General",
"t": "g"
},
"v": "value3"
}
],
[
{
"m": "value2",
"ct": {
"fa": "General",
"t": "g"
},
"v": "value2"
},
{
"m": "value4",
"ct": {
"fa": "General",
"t": "g"
},
"v": "value4"
}
]
]
luckysheet.setRangeValue(data,{range:"A1:B2"})
Parameter:
{String | Number | Object} [value]: Specific setting value, one attribute will correspond to multiple values, refer to the value example of cell attribute table, special case: if The attribute type attr
is the cell format ct
, then the setting value value
should provide ct.fa
, for example, set the cell format of "A1:B2"
to percentage format:
To
luckysheet.setRangeFormat("ct", "0.00%", {range:"A1:B2"})
{PlainObject} [setting]: optional parameters
"A1:B2"
, "sheetName!A1:B2"
or {row:[0,1], column:[0,1]}
, allows an array of multiple selections; the default is the current selectionExplanation:
Set the cell format of the specified range, generally used as a processing format, the assignment operation recommends using the setRangeValue
method
When setting the border, attr is "bd"
, value is a key/value object, and the border type: borderType
/border thickness:style
/border color:color
need to be set at the same time, such as setting " A1:B2"
The border of the cell is all/red/thin:
luckysheet.setRangeFormat("bd", {borderType: "border-right",style: "1", color: "#ff0000"}, {range:["A1:B2"]})
The complete optional setting parameters are as follows:
borderType: "border-left" | "border-right" | "border-top" | "border-bottom" | "border-all" | "border-outside" | "border-inside" | "border -horizontal" | "border-vertical" | "border-none"
,style: 1 Thin | 2 Hair | 3 Dotted | 4 Dashed | 5 DashDot | 6 DashDotDot | 7 Double | 8 Medium | 9 MediumDashed | 10 MediumDashDot | 11 MediumDashDotDot | 12 SlantedDashDot | 13 Thick
color: hexadecimal color value
Usage:
Set the cell text in the current worksheet "A1:B2"
range to be bold
luckysheet.setRangeFormat("bl", 1, {range:"A1:B2"})
Set the background of the cells in the range of "B2"
and "C4:D5"
of the second worksheet to red
luckysheet.setRangeFormat("bg", "#ff0000", {range:["B2","C4:D5"], order:1})
[todo]
Parameter:
{String} [type]: Turn on or off the filtering function
Possible values of type
are:
"open"
: Open the filter function and return the current filtered range object"close"
: Close the filter function and return to the scope of the filter before closing{PlainObject} [setting]: optional parameters
"A1:B2"
, "sheetName!A1:B2"
or {row:[0,1],column: [0,1]}
, can only be a single selection; the default is the current selectionExplanation:
For the worksheet of the specified subscript, the filter function is turned on or off for the selected range
Usage:
luckysheet.setRangeFilter("open",{range:"A1:B2",order:1})
Parameter:
{String} [type]: merge cell type
Possible values of type
are:
"all"
: Merge all, all cells in the area are merged into one large cell"horizontal"
: merge horizontally, cells in the same row in the area are merged into one cell"vertical"
: merge vertically, the cells in the same column in the area are merged into one cell{PlainObject} [setting]: optional parameters
"A1:B2"
, "sheetName!A1:B2"
or {row:[0,1],column: [0,1]}
, allows an array of multiple selections; the default is the current selectionExplanation:
Set the merged cells for the worksheet with the specified subscript and the selected range
Usage:
The current selection'A1:B2' is set to merge cells, the type is merge all
luckysheet.setRangeMerge("all")
The data of'A1:B1' is:
[
[
{
"m": "value1",
"ct": { "fa": "General", "t": "g" },
"v": "value1",
"mc": { "r": 0, "c": 0, "rs": 2, "cs": 2 }
},
{
"mc": { "r": 0, "c": 0 }
}
],
[
{
"mc": { "r": 0, "c": 0 }
},
{
"mc": { "r": 0, "c": 0 }
}
]
]
Parameter:
"A1:B2"
, "sheetName!A1:B2"
or {row:[0,1],column: [0,1]}
, allows an array of multiple selections; the default is the current selectionExplanation:
Unmerge cells in the selected range for the worksheet with the specified subscript
Usage:
The current selection'A1:B2' is already a merged cell, now you want to cancel the merge
luckysheet.cancelRangeMerge()
Parameter:
{String} [type]: sort type
Possible values of type
are:
"asc"
: ascending order"des"
: descending order
{PlainObject} [setting]: optional parameters
"A1:B2"
, "sheetName!A1:B2"
or {row:[0,1],column: [0,1]}
, can only be a single selection; the default is the current selectionExplanation:
For the worksheet of the specified subscript, the sort function is turned on for the selected range, and the sorted data of the selected range is returned.
Usage:
luckysheet.setRangeSort("asc")
Parameter:
[{ i:0,sort:'asc' },{ i:1,sort:'des' }]
{PlainObject} [setting]: optional parameters
"A1:B2"
, "sheetName!A1:B2"
or {row:[0,1],column: [0,1]}
, can only be a single selection; the default is the current selectionExplanation:
For the worksheet of the specified subscript, the selected range enables the multi-column custom sorting function to return the sorted data of the selected range.
Usage:
luckysheet.setRangeSortMulti(true,[{ i:0,sort:'asc' },{ i:1,sort:'des' }])
Parameter:
{String} [conditionName]: Conditional format rule type
Possible values of conditionName
are:
"greaterThan"
: greater than (conditionValue value is numeric or cell range)"lessThan"
: Less than (conditionValue value is numeric value or cell range)"betweenness"
: between (conditionValue value is numeric value or cell range)"equal"
: equal to (conditionValue value is numeric value or cell range)"textContains"
: text contains (conditionValue value is text or cell range)"occurrenceDate"
: date of occurrence (conditionValue value is date)"duplicateValue"
: Duplicate value (conditionValue value is '0': duplicate value, '1': unique value)"top10"
: the first N items (conditionValue value is 1~1000)"top10%"
: Top N% (conditionValue value is 1~1000)"last10"
: the last N items (conditionValue is 1~1000)"last10%"
: Last N% (conditionValue value is 1~1000)"AboveAverage"
: above average (conditionValue can be an empty array)"SubAverage"
: below average (conditionValue can be an empty array)
{Array} [conditionValue]: You can set condition cells or condition values Value rules (at least one value in the condition value array and at most two values)
[2]
Or (if the value is the cell range, take the cell value in the upper left corner)
['A1']
{PlainObject} [setting]: optional parameters
{Object} [format]: color setting
{
"textColor": "#000000",
"cellColor": "#ff0000"
}
{Array | Object | String} [cellrange]: The range of the selection, the format of the supported selection is "A1:B2"
, "sheetName!A1:B2"
or {row:[0,1],column: [0,1]}
, allows an array of multiple selections; the default is the current selection
{Number} [order]: Worksheet subscript; the default value is the current worksheet subscript
{Function} [success]: callback function for the end of the operation
Explanation:
For the worksheet of the specified subscript, the conditional formatting is enabled for the selected range, and some cells are highlighted according to the set conditional formatting rules, and the data after the conditional formatting is enabled is returned.
Usage:
Highlight cells with content greater than the number 2
luckysheet.setRangeConditionalFormatDefault("greaterThan",{ type: 'value', content: [2] })
Highlight the cells whose content is less than the content of cell A1
luckysheet.setRangeConditionalFormatDefault("lessThan",{ type: 'range', content: ['A1'] })
Highlight cells with content between 2 and 10
luckysheet.setRangeConditionalFormatDefault("betweenness",{ type: 'value', content: [2,10] })
Highlight the cell whose content is equal to the content of cell A1
luckysheet.setRangeConditionalFormatDefault("equal",{ type: 'range', content: ['A1'] })
Highlight the cell that contains the content of cell A1
luckysheet.setRangeConditionalFormatDefault("textContains",{ type: 'range', content: ['A1'] })
Highlight cells with dates between 2020/09/24-2020/10/15
luckysheet.setRangeConditionalFormatDefault("occurrenceDate",{ type: 'value', content: ['2020/09/24 - 2020/10/15'] })
Highlight cells with repeated values, content is 0
luckysheet.setRangeConditionalFormatDefault("duplicateValue",{ type: 'value', content: [0] })
Highlight the cell with unique value, content is 1
luckysheet.setRangeConditionalFormatDefault("duplicateValue",{ type: 'value', content: [1] })
Highlight the top 20 cells
luckysheet.setRangeConditionalFormatDefault("top",{ type: 'value', content: [20] })
Highlight the top 30% of cells
luckysheet.setRangeConditionalFormatDefault("topPercent",{ type: 'value', content: [30] })
Highlight the bottom 15 cells
luckysheet.setRangeConditionalFormatDefault("last",{ type: 'value', content: [15] })
Highlight the bottom 15% of cells
luckysheet.setRangeConditionalFormatDefault("lastPercent",{ type: 'value', content: [15] })
Highlight cells that are above average
luckysheet.setRangeConditionalFormatDefault("AboveAverage",{ type: 'value', content: ['AboveAverage'] })
Highlight cells below average
luckysheet.setRangeConditionalFormatDefault("SubAverage",{ type: 'value', content: ['SubAverage'] })
Parameter:
{String} [type]: Conditional formatting rule type
Possible values of type
are:
"dataBar"
: data bar"icons"
: icon set"colorGradation"
: Color Gradation
{PlainObject} [setting]: optional parameters
{Array | String} [format]: Color setting
When type
is dataBar
, the gradient color should be set; the default value is blue-white gradient["#638ec6", "#ffffff"]
Recommended shortcut value:
["#638ec6", "#ffffff"], //Blue-white gradient data bar
["#63c384", "#ffffff"], //Green-white gradient data bar
["#ff555a", "#ffffff"], //Red-white gradient data bar
["#ffb628", "#ffffff"], //Orange-white gradient data bar
["#008aef", "#ffffff"], //Light blue-white gradient data bar
["#d6007b", "#ffffff"], //Purple-white gradient data bar
["#638ec6"], //Blue data bar
["#63c384"], //green data bar
["#ff555a"], //Red data bar
["#ffb628"], //Orange data bar
["#008aef"], //Light blue data bar
["#d6007b"] //Purple data bar
When type
is icons
, the icon type should be set; the default value is "threeWayArrowMultiColor": the three-way arrow color,
Possible values are:
threeWayArrowMultiColor
: three-way arrow (color),
threeTriangles
: 3 triangles,
fourWayArrowMultiColor
: four-way arrow (color),
fiveWayArrowMultiColor
: five-way arrow (color),
threeWayArrowGrayColor
: three-way arrow (gray),
fourWayArrowGrayColor
: four-way arrow (gray),
fiveWayArrowGrayColor
: five-way arrow (gray),
threeColorTrafficLightRimless
: three-color traffic light (no border),
threeSigns
: three signs,
greenRedBlackGradient
: green-red-black gradient,
threeColorTrafficLightBordered
: three-color traffic light (with border),
fourColorTrafficLight
: Four-color traffic light,
threeSymbolsCircled
: three symbols (with a circle),
tricolorFlag
: tricolor flag,
threeSymbolsnoCircle
: three symbols (no circle),
threeStars
: 3 stars,
fiveQuadrantDiagram
: five-quadrant diagram,
fiveBoxes
: 5 boxes,
grade4
: Four grades,
grade5
: Five grades,
When type
is colorGradation
, the color value of the color scale should be set; the default value is green-yellow-red scale["rgb(99, 190, 123)", "rgb(255, 235, 132)", "rgb(248, 105, 107)"]
Recommended shortcut value:
["rgb(99, 190, 123)", "rgb(255, 235, 132)", "rgb(248, 105, 107)"], //green-yellow-red level
["rgb(248, 105, 107)", "rgb(255, 235, 132)", "rgb(99, 190, 123)"], //red-yellow-green level
["rgb(99, 190, 123)", "rgb(252, 252, 255)", "rgb(248, 105, 107)"], //green-white-red level
["rgb(248, 105, 107)", "rgb(252, 252, 255)", "rgb(99, 190, 123)"], //red-white-green level
["rgb(90, 138, 198)", "rgb(252, 252, 255)", "rgb(248, 105, 107)"], //blue-white-red level
["rgb(248, 105, 107)", "rgb(252, 252, 255)", "rgb(90, 138, 198)"], //red-white-blue level
["rgb(252, 252, 255)", "rgb(248, 105, 107)"], //white-red level
["rgb(248, 105, 107)", "rgb(252, 252, 255)"], //red-white level
["rgb(99, 190, 123)", "rgb(252, 252, 255)"], //green-white level
["rgb(252, 252, 255)", "rgb(99, 190, 123)"], //white-green level
["rgb(99, 190, 123)", "rgb(255, 235, 132)"], //green-yellow level
["rgb(255, 235, 132)", "rgb(99, 190, 123)"] //Yellow-green level
{Array | Object | String} [cellrange]: The range of the selection, the format of the supported selection is "A1:B2"
, "sheetName!A1:B2"
or {row:[0,1],column: [0,1]}
, allows an array of multiple selections; the default is the current selection
{Number} [order]: Worksheet subscript; the default value is the current worksheet subscript
{Function} [success]: callback function for the end of the operation
Explanation:
For the worksheet of the specified subscript, the conditional format is turned on for the selected range, and the data after the conditional format is turned on is returned.
Usage:
luckysheet.setRangeConditionalFormat("dataBar", { format: ["#63c384", "#ffffff"] })
[todo]
Parameter:
{Number} [itemIndex]: Conditional format rule index
{PlainObject} [setting]: optional parameters
Explanation:
For the worksheet of the specified subscript, delete the conditional format rule, and return the deleted conditional format rule.
Usage:
luckysheet.deleteRangeConditionalFormat(2)
[todo]
Parameter:
"A1:B2"
, "sheetName!A1:B2"
or {row:[0,1] ,column:[0,1]}
, allows an array of multiple selections; the default is the current selectionExplanation:
Clear the contents of the specified cell area of the specified worksheet, return the cleared data, which is different from the function of deleting the selection area, no need to set the cell movement
Usage:
luckysheet.clearRange()
[todo]
Parameter:
{String} [move]: After deleting, whether the cells on the right or below move
Possible values of move
are:
"left"
: Move the right cell to the left"up"
: Move the lower cell up{PlainObject} [setting]: optional parameters
"A1:B2"
, "sheetName!A1:B2"
or {row:[0,1] ,column:[0,1]}
, allows an array composed of multiple selections; the default is the current selectionExplanation:
Delete the specified cell range of the specified worksheet, return the deleted data, and at the same time, specify whether to move the right cell to the left or the bottom cell to move up
Usage:
luckysheet.deleteRange('left')
[todo]
Parameter:
{String} [move]: Move the active cell right or down
Possible values of move
are:
"right"
: Move the active cell to the right"bottom"
: move the active cell down
{PlainObject} [setting]: optional parameters
"A1:B2"
, "sheetName!A1:B2"
or {row:[0, 1],column:[0,1]}
, the default is the current selection
When data data is not set, an array composed of multiple selections is allowed, and the blank area inserted is the area of these selections.
When the data data is set, it can only be a single selection, and the data data will be inserted into the first cell position of the current selection
Explanation:
In the specified cell area of the specified worksheet, assign cell data, or create a new blank area, return data data, and at the same time, specify the active cell to move right or down
Usage:
luckysheet.insertRange('right')
[todo]
Parameter:
{String} [type]: the type of matrix operation
Possible values of type
are:
"flipUpDown"
: flip up and down"flipLeftRight"
: flip left and right"flipClockwise"
: rotate clockwise"flipCounterClockwise"
: rotate counterclockwise"transpose"
: Transpose"deleteZeroByRow"
: delete 0 values at both ends by row"deleteZeroByColumn"
: delete zero values at both ends by column"removeDuplicateByRow"
: delete duplicate values by row"removeDuplicateByColumn"
: remove duplicate values by column"newMatrix"
: Produce a new matrix{PlainObject} [setting]: optional parameters
"A1:B2"
, "sheetName!A1:B2"
or {row:[0,1],column: [0,1]}
, can only be a single selection; the default is the current selectionExplanation:
Specify the data in the specified cell area of the worksheet to perform matrix operations, and return the result data after the operation is successful
Usage:
Flip current selection upside down
luckysheet.matrixOperation('flipUpDown')
Copy the original selection as a two-dimensional array:
[["value1","value3"],["value2","value4"]]
After flipping up and down, the selection is copied as a two-dimensional array:
[["value2","value4"],["value1","value3"]]
[todo]
Parameter:
{String} [type]: calculation method
Possible values of type
are:
"plus"
: add"minus"
: subtract"multiply"
: multiply"divided"
: Divide"power"
: power"root"
: power root"log"
: log{Number} [number]: Calculate the number, such as: 2
{PlainObject} [setting]: optional parameters
"A1:B2"
, "sheetName!A1:B2"
or {row:[0,1],column: [0,1]}
, can only be a single selection; the default is the current selectionExplanation:
Specify the data in the specified cell area of the worksheet for matrix calculation, and return the result data after the calculation is successful
Usage:
Add 2 to the value of all cells in the current selection
luckysheet.matrixCalculation('plus', 2)
Copy the original selection as a two-dimensional array:
[[1,2],[3,4]]
After adding 2, the selection is copied as a two-dimensional array:
[[3,4],[5,6]]
Explanation:
Return all worksheet configurations, the format is the same as the worksheet configuration, and the results obtained can be used as options.data when the form is initialized.
Therefore, this API is suitable for manually operating and configuring a table, and then taking out all the worksheet information to save it, and then use it for table creation in other places. If you want to get all the workbook data including the workbook configuration, it is recommended to use toJson, and it can be directly used to initialize Luckysheet.
Usage:
luckysheet.getAllSheets()[0]
Explanation:
Returns a one-dimensional array luckysheetfile
of all table data structures. Unlike the getAllSheets
method, the worksheet parameters obtained by this method will contain many internal variables. The most obvious difference is that the table data operation will maintain luckysheetfile[i]. data
, and the initialization data uses options.data[i].celldata
, so luckysheetfile
can be used for debugging, but the initialization table is not applicable.
In addition, a load = 1
will be added to the loaded worksheet parameters, this parameter needs to be set to 0 when initializing the data. Therefore, to initialize the workbook with the data obtained by getLuckysheetfile()
, two tasks need to be done:
Now there is getAllSheets
to complete this work, no need to manually convert the data.
Usage:
luckysheet.getLuckysheetfile()[0]
[todo]
Parameter:
Explanation:
According to index/order/name, quickly return the configuration of the specified worksheet, same as luckysheetfile[i]
. If multiple parameters are set, the priority is: index> order> name.
[todo]
Parameter:
Explanation:
Quickly return the data of the specified worksheet, same as luckysheetfile[i].data
Parameter:
Explanation:
Quickly return to the config configuration of the specified worksheet, same as luckysheetfile[i].config
Parameter:
Explanation:
Quickly set the current worksheet config configuration
参数:
说明:
Update the corresponding sheet according to the set sheet configuration
Parameter:
Explanation:
Add a sheet and return the newly added worksheet object. The optional setting data in setting
is sheetObject
, and a blank worksheet will be added if sheetObject
is not passed.
Usage:
luckysheet.setSheetAdd()
[todo]
Parameter:
Explanation:
Delete the worksheet of the specified subscript and return the deleted worksheet object
Usage:
luckysheet.setSheetDelete()
[todo]
Parameter:
Explanation:
Copy the worksheet with the specified subscript to the specified subscript position, optionally set the specified subscript position targetOrder
in setting
, and return the newly copied worksheet object
Usage:
luckysheet.setSheetCopy()
[todo]
Parameter:
Explanation:
Hide the worksheet of the specified subscript and return the hidden worksheet object
Usage:
luckysheet.setSheetHide(true)
luckysheet.setSheetHide({order:2})
[todo]
Parameter:
Explanation:
Unhide the worksheet of the specified subscript, and return the unhidden worksheet object
Usage:
luckysheet.setSheetShow({order:2})
[todo]
Parameter:
Explanation:
Set the worksheet of the specified subscript as the current worksheet (active state), that is, switch to the specified worksheet and return the activated worksheet object
Usage:
luckysheet.setSheetActive(1)
[todo]
Parameter:
Explanation:
Modify worksheet name
Usage:
luckysheet.setSheetName("CellSheet")
[todo]
Parameter:
Explanation:
Set the color at the worksheet name
Usage:
luckysheet.setSheetColor("#ff0000")
Parameter:
{String | Number} [type]: The moving direction of the worksheet or the subscript of the moving target,
Possible values of type
are:
"left"
: to the left"right"
: to the right1
/2
/3
/...: Specify subscript{PlainObject} [setting]: optional parameters
Explanation:
Specify the worksheet to move one position to the left or right, or specify subscript, and return the specified worksheet object
Usage:
luckysheet.setSheetMove("left")
luckysheet.setSheetMove(3,{order:1})
[todo]
Parameter:
[
{index:'sheet_01',order: 2},
{index:'sheet_02',order: 1},
{index:'sheet_03',order: 0},
]
The order in the array is not important, the key is to specify the correspondence between sheet index and order.
Explanation:
Reorder the positions of all worksheets and specify an array of worksheet order.
Usage:
js
luckysheet.setSheetOrder([
{index:'sheet_01',order: 2},
{index:'sheet_02',order: 1},
{index:'sheet_03',order: 0},
])
[todo]
Parameter:
{Number} [zoom]: Worksheet zoom ratio
{PlainObject} [setting]: optional parameters
Explanation:
Set worksheet zoom ratio
Usage:
js
luckysheet.setSheetZoom(0.5)
Parameter:
Explanation:
Show the grid lines of the specified subscript worksheet, and return the worksheet object of the operation
Usage:
luckysheet.showGridLines()
luckysheet.showGridLines({order:2})
Parameter:
Explanation:
Hide the grid lines of the specified subscript worksheet, and return the worksheet object of the operation
Usage:
luckysheet.hideGridLines()
luckysheet.hideGridLines({order:2})
Parameter:
Explanation:
Initialize a Luckysheet, which can contain multiple worksheets, refer to Configuration List
[todo]
Parameter:
Explanation:
Refresh canvas
参数:
说明:
Scroll current worksheet position
Parameter:
Explanation:
Automatically resize the canvas according to the window size
Parameter:
Explanation:
Delete and release table
[todo]
Parameter:
"A1:B2"
, "sheetName!A1:B2"
or {row:[0,1],column: [0,1]}
, can only be a single selection; the default is the current selectionExplanation:
Returns the base64 format image generated after the screenshot of the specified selection
Parameter:
Explanation:
Set workbook name
Parameter:
Explanation:
get workbook name
[todo]
Parameter:
Explanation:
Undo the current operation and return the operation object that was just undone
[todo]
Parameter:
Explanation:
Redo the current operation and return the operation object that was just redone
Parameter:
Explanation:
Force refresh formula. When you directly modify the values of multiple cells without triggering a refresh, and these cells are associated with formulas, you can use this API to force a formula refresh to be triggered at the end.
Parameter:
Explanation:
Refreshes the top status bar status of the specified cell.
Parameter:
Explanation:
Check whether the status of all specified types of cells in the selection meets the conditions (mainly bold, italics, strikeouts, underscores, etc.).
[todo]
Parameter:
"A1:B2"
, "sheetName!A1:B2"
or {row:[0,1] ,column:[0,1]}
, can only be a single selection; the default is the current selectionExplanation:
Generate a chart in the specified selection area of the specified worksheet, and return the chart parameter object, including the chart id
[todo]
Parameter:
{String} [attr]: attribute type
Possible values of attr
are:
"left"
: the distance from the left to the edge of the worksheet"top"
: the distance from the top edge to the edge of the worksheet"width"
: the width of the chart frame"height"
: the height of the chart outline"chartOptions"
: detailed settings for the chart
{Number | Object}} [value]: attribute value, when attr
is chartOptions
, directly set the configuration object of the entire chart
{PlainObject} [setting]: optional parameters
Explanation:
Modify the parameters of the specified id chart and return the modified parameters of the entire chart
[todo]
Parameter:
Explanation:
Get the parameters of the specified id chart
[todo]
Parameter:
Explanation:
Delete the chart with the specified id and return the parameters of the deleted chart
[todo]
Parameter:
"A1:B2"
, "sheetName!A1:B2"
or {row:[0,1] ,column:[0,1]}
, can only be a single selection; the default is the current selectionExplanation:
Specify the worksheet range to set the data verification function and set the parameters
[todo, to be confirmed whether it is reasonable]
Parameter:
"A1:B2"
, "sheetName!A1:B2"
or {row:[0,1] ,column:[0,1]}
, can only be a single selection; the default is the current selectionExplanation:
Specify the worksheet range to delete the data verification function
[todo]
Parameter:
Explanation:
Specify the worksheet to set the worksheet protection
Parameter:
Explanation:
data => celldata, data two-dimensional array data is converted into a one-dimensional array in {r, c, v} format
[todo]
Parameter:
Explanation:
celldata => data, the celldata one-dimensional array data is converted into the two-dimensional array required by the table
Explanation:
The exported json string can be directly used as the parameter options
when the workbook is initialized by luckysheet.create(options)
. The usage scenario is to manually save all the parameters after the user manipulates the table, and then initialize the table elsewhere. Use, similar to the import and export of a luckysheet proprietary format.
::: warning To maintain compatibility, the old version of the API is still supported, but its use is deprecated. :::
Parameter:
Explanation:
This method is to get the value of the cell.
Special case: the cell format is yyyy-MM-dd, when the type is'v', the display value of'm' will be mandatory
Recommend to use the new API: getCellValue
Explanation:
Returns a one-dimensional array luckysheetfile
of all table data structures
Recommend to use new API: getLuckysheetfile
Explanation:
Quickly return to the current sheet config configuration, the config information of each worksheet is still contained in the luckysheetfile.
Recommend to use new API: getConfig
Explanation:
Returns an array of current selection objects, there may be multiple selections.
Recommend to use new API: getRange
Parameter:
object: {row: [r1, r2], column: [c1, c2] }
; the default is the current first selection.Explanation:
Returns the data of the first selection in a table.
luckysheet.getdatabyselection()
: Returns the data of the current selection of the current worksheetluckysheet.getdatabyselection(null,1)
: Returns the data of the current selection of the second worksheetRecommend to use the new API: getRangeValue
Parameter:
Explanation:
Refresh the canvas display data according to scrollWidth and scrollHeight.
Parameter:
Explanation:
Set the value of a cell. Can be used with luckysheet.jfrefreshgrid()
to refresh and view cell value changes.
luckysheet.setcellvalue(0, 0, luckysheet.flowdata(), 'abc');
luckysheet.jfrefreshgrid();
Explanation:
Refresh canvas
Recommended new API: refresh
Parameter:
[{ row: [r1, r2], column: [c1, c2] }]
.Explanation:
Set the value of the current table selection area. With luckysheet.selectHightlightShow()
, you can view the selection changes in the interface.
luckysheet.setluckysheet_select_save([{ row: [0, 1], column: [0, 1] }]);
luckysheet.selectHightlightShow();
Recommend to use new API:setRangeShow
Explanation:
Highlight the current selection
Recommend to use new API:setRangeShow
Explanation:
Quickly get the data of the current table
Recommend to use new API:getSheetData
Parameter:
Explanation:
Generate a two-dimensional array that the table can recognize
Recommend to use new API:transToData
Parameter:
Explanation:
Convert two-dimensional array data into {r, c, v}
format one-dimensional array
Recommend to use new API:transToCellData