### Show Toolbar Example: Undo/Redo and Font
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
This example demonstrates how to configure the toolbar to only show the undo/redo and font buttons, while hiding all others.
```javascript
//options
{
showtoolbar: false,
showtoolbarConfig:{
undoRedo: true,
font: true,
}
}
```
--------------------------------
### Show Toolbar Example: Hide Image and Print
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
This example shows how to hide specific buttons like 'image' and 'print' from the toolbar, while keeping the toolbar visible.
```javascript
//options
{
showtoolbar: true, // 默认就是true,可以不设置
showtoolbarConfig:{
image: false,
print: false,
}
}
```
--------------------------------
### Show Toolbar Example: Custom Order and Font Styles
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
This example customizes the toolbar to display 'protection' first, followed by font style-related buttons, using an array configuration.
```json
{
"showtoolbarConfig": [
"protection", "|",
"font", "|",
"fontSize", "|",
"bold", "italic", "strikethrough", "underline", "textColor"
]
}
```
--------------------------------
### Show Sheet Bar Example: Hide Add and Menu
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
This example demonstrates hiding the 'add' and 'menu' functionalities from the sheet bar, while keeping the sheet tabs visible.
```javascript
//options
{
showsheetbar: true, // 默认就是true,可以不设置
showsheetbarConfig:{
add: false,
menu: false,
}
}
```
--------------------------------
### Show Statistic Bar Example: Only Zoom Button
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
This example configures the statistic bar to only display the 'zoom' button, hiding the count and print view functionalities.
```javascript
//options
{
showstatisticBar: false,
showstatisticBarConfig:{
zoom: true,
}
}
```
--------------------------------
### Show Sheet Bar Example: Only Add Button
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
This example configures the sheet bar to only display the 'add' button, hiding the sheet management menu and sheet tabs.
```javascript
//options
{
showsheetbar: false,
showsheetbarConfig:{
add: true,
}
}
```
--------------------------------
### Show Statistic Bar Example: Hide Print View
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
This example demonstrates hiding the 'view' (print view) functionality from the statistic bar, while keeping count and zoom visible.
```javascript
//options
{
showstatisticBar: true, // 默认就是true,可以不设置
showstatisticBarConfig:{
view: false,
}
}
```
--------------------------------
### Custom Cell Rendering After Draw
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
Use cellRenderAfter to execute custom drawing logic after a cell has been rendered. This example draws two images in the top-left and bottom-right corners of cell D1.
```javascript
luckysheet.create({
hook: {
cellRenderAfter: function (cell, position, sheetFile, ctx) {
var r = position.r;
var c = position.c;
if (r === 0 && c === 3) { // 指定处理D1单元格
if (!window.storeUserImage) {
window.storeUserImage = {}
}
if (!window.storeUserImage[r + '_' + c]) {
window.storeUserImage[r + '_' + c] = {}
}
var img = null;
var imgRight = null;
if (window.storeUserImage[r + '_' + c].image && window.storeUserImage[r + '_' + c].imgRight) {
// 加载过直接取
img = window.storeUserImage[r + '_' + c].image;
imgRight = window.storeUserImage[r + '_' + c].imgRight;
} else {
img = new Image();
imgRight = new Image();
img.src = 'https://www.dogedoge.com/favicon/developer.mozilla.org.ico';
imgRight.src = 'https://www.dogedoge.com/static/icons/twemoji/svg/1f637.svg';
// 图片缓存到内存,下次直接取,不用再重新加载
window.storeUserImage[r + '_' + c].image = img;
window.storeUserImage[r + '_' + c].imgRight = imgRight;
}
if (img.complete) { // 已经加载完成的直接渲染
ctx.drawImage(img, position.start_c, position.start_r, 10, 10);
} else {
img.onload = function () {
ctx.drawImage(img, position.start_c, position.start_r, 10, 10);
}
}
if (imgRight.complete) {
ctx.drawImage(imgRight, position.end_c - 10, position.end_r - 10, 10, 10);
} else {
imgRight.onload = function () {
ctx.drawImage(imgRight, position.end_c - 10, position.end_r - 10, 10, 10);
}
}
}
}
}
})
```
--------------------------------
### Show Toolbar Configuration Array
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
This array configuration allows for precise control over the order and placement of toolbar buttons and separators.
```json
[
"undo", "redo", "paintFormat", "|",
"currencyFormat", "percentageFormat", "numberDecrease", "numberIncrease", "moreFormats", "|",
"font", "|",
"fontSize", "|",
"bold", "italic", "strikethrough", "underline", "textColor", "|",
"fillColor", "border", "mergeCell", "|",
"horizontalAlignMode", "verticalAlignMode", "textWrapMode", "textRotateMode", "|",
"image", "link", "chart", "postil", "pivotTable", "|",
"function", "frozenMode", "sortAndFilter", "conditionalFormat", "dataVerification", "splitColumn", "screenshot", "findAndReplace", "protection", "print"
]
```
--------------------------------
### Show Toolbar Configuration Object
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
Defines which toolbar items to show or hide. This object provides fine-grained control over individual toolbar buttons.
```json
{
undoRedo: false, //撤销重做,注意撤消重做是两个按钮,由这一个配置决定显示还是隐藏
paintFormat: false, //格式刷
currencyFormat: false, //货币格式
percentageFormat: false, //百分比格式
numberDecrease: false, // '减少小数位数'
numberIncrease: false, // '增加小数位数
moreFormats: false, // '更多格式'
font: false, // '字体'
fontSize: false, // '字号大小'
bold: false, // '粗体 (Ctrl+B)'
italic: false, // '斜体 (Ctrl+I)'
strikethrough: false, // '删除线 (Alt+Shift+5)'
underline: false, // '下划线 (Alt+Shift+6)'
textColor: false, // '文本颜色'
fillColor: false, // '单元格颜色'
border: false, // '边框'
mergeCell: false, // '合并单元格'
horizontalAlignMode: false, // '水平对齐方式'
verticalAlignMode: false, // '垂直对齐方式'
textWrapMode: false, // '换行方式'
textRotateMode: false, // '文本旋转方式'
image:false, // '插入图片'
link:false, // '插入链接'
chart: false, // '图表'(图标隐藏,但是如果配置了chart插件,右击仍然可以新建图表)
postil: false, //'批注'
pivotTable: false, //'数据透视表'
function: false, // '公式'
frozenMode: false, // '冻结方式'
sortAndFilter: false, // '排序和筛选'
conditionalFormat: false, // '条件格式'
dataVerification: false, // '数据验证'
splitColumn: false, // '分列'
screenshot: false, // '截图'
findAndReplace: false, // '查找替换'
protection:false, // '工作表保护'
print:false // '打印'
}
```
--------------------------------
### Initialize Luckysheet with Basic Options
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
Configure the Luckysheet table with essential settings like the container ID, title, and language. This is the primary method for setting up a new Luckysheet instance.
```javascript
// Configuration options
const options = {
container: 'luckysheet', // Set the DOM container ID
title: 'Luckysheet Demo', // Set the table name
lang: 'zh' // Set the table language
// More other settings...
}
// Initialize the table
luckysheet.create(options)
```
--------------------------------
### Configure User Menu Items
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
Define the menu items that appear when the user information in the top-right corner is clicked. Each item can have a URL, an icon, and a name.
```javascript
userMenuItem: [{url:"www.baidu.com", "icon":'', "name":"My Tables"}, {url:"www.baidu.com", "icon":'', "name":"Logout"}]
```
--------------------------------
### sheetShowAfter
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
Triggered after a sheet is shown. It receives the configuration of the shown sheet.
```APIDOC
## sheetShowAfter
### Description
Triggered after a sheet is shown. It receives the configuration of the shown sheet.
### Parameters
#### Path Parameters
- None
#### Query Parameters
- None
#### Request Body
- **sheet** (Object) - Optional - The configuration of the sheet that was shown.
```
--------------------------------
### Configure User Info Display
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
Set the display style for user information in the top-right corner. Supports HTML templates, plain strings, boolean values, or an object with user image and name.
```javascript
options:{
// Other configurations
userInfo:' Lucky',
}
```
```javascript
options:{
// Other configurations
userInfo:'Lucky',
}
```
```javascript
options:{
// Other configurations
userInfo:false, // Do not display user information
}
```
```javascript
options:{
// Other configurations
userInfo:true, // Display HTML:' Lucky'
}
```
```javascript
options:{
// Other configurations
userInfo: {
userImage:'https://cdn.jsdelivr.net/npm/luckyresources@1.0.3/assets/img/logo/logo.png', // Avatar URL
userName:'Lucky' // Username
}
}
```
--------------------------------
### Show Sheet Bar Configuration Object
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
This object allows customization of the sheet bar, controlling the visibility of 'add', 'menu', and 'sheet' functionalities.
```json
{
add: false, //新增sheet
menu: false, //sheet管理菜单
sheet: false //sheet页显示
}
```
--------------------------------
### sheetShowBefore
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
Triggered before a sheet is shown. It receives the configuration of the sheet to be shown.
```APIDOC
## sheetShowBefore
### Description
Triggered before a sheet is shown. It receives the configuration of the sheet to be shown.
### Parameters
#### Path Parameters
- None
#### Query Parameters
- None
#### Request Body
- **sheet** (Object) - Optional - The configuration of the sheet to be shown.
```
--------------------------------
### Pager Configuration
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
Configure pager buttons and display options. The pager UI is handled by sPage, and custom data requests/rendering should be managed in the onTogglePager hook.
```javascript
pager: {
pageIndex: 1, //当前页码,必填
total: 100, //数据总条数,必填
selectOption: [10, 20, 30], // 选择每页的行数,
pageSize: 10, //每页显示多少条数据,默认10条
showTotal: false, // 是否显示总数,默认关闭:false
showSkip: false, //是否显示跳页,默认关闭:false
showPN: false, //是否显示上下翻页,默认开启:true
prevPage: '', //上翻页文字描述,默认"上一页"
nextPage: '', //下翻页文字描述,默认"下一页"
totalTxt: '', // 数据总条数文字描述,默认"总共:{total}"
}
```
--------------------------------
### Configure Function Buttons
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
Set up custom buttons for the top-right corner of the sheet. This allows for adding actions like download, share, or data display.
```javascript
functionButton: ' '
```
--------------------------------
### Show Statistic Bar Configuration Object
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
This object customizes the statistic bar, controlling the visibility of 'count', 'view', and 'zoom' functionalities.
```json
{
count: false, // 计数栏
view: false, // 打印视图
zoom: false, // 缩放
}
```
--------------------------------
### sheetCopyAfter
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
Triggered after a sheet is copied. It receives the configuration of the newly created sheet.
```APIDOC
## sheetCopyAfter
### Description
Triggered after a sheet is copied. It receives the configuration of the newly created sheet.
### Parameters
#### Path Parameters
- None
#### Query Parameters
- None
#### Request Body
- **sheet** (Object) - Optional - The configuration of the newly created sheet.
```
--------------------------------
### sheetCreateAfter
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
Triggered after a new sheet is created. This includes the creation of pivot tables. It receives the configuration of the newly created sheet.
```APIDOC
## sheetCreateAfter
### Description
Triggered after a new sheet is created. This includes the creation of pivot tables. It receives the configuration of the newly created sheet.
### Parameters
#### Path Parameters
- None
#### Query Parameters
- None
#### Request Body
- **sheet** (Object) - Optional - The configuration of the newly created sheet.
```
--------------------------------
### sheetCopyBefore
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
Triggered before a sheet is copied. It receives the configuration of the target sheet and the copied sheet.
```APIDOC
## sheetCopyBefore
### Description
Triggered before a sheet is copied. It receives the configuration of the target sheet and the copied sheet.
### Parameters
#### Path Parameters
- None
#### Query Parameters
- None
#### Request Body
- **targetSheet** (Object) - Optional - The configuration of the sheet to be copied.
- **copySheet** (Object) - Optional - The configuration of the sheet that is being copied.
```
--------------------------------
### JSON Response Structure for loadUrl
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
Illustrates the expected JSON string format for the response from the `loadUrl` endpoint. It includes data for the initial sheet (status 1) and configuration for other sheets (status 0).
```json
[
// Sheet with status 1, requires initial data celldata
{
"name": "Cell",
"index": "sheet_01",
"order": 0,
"status": 1,
"celldata": [{"r":0,"c":0,"v":{"v":1,"m":"1","ct":{"fa":"General","t":"n"}}}]
},
// Other sheets with status 0, only configuration is needed
{
"name": "Data",
"index": "sheet_02",
"order": 1,
"status": 0
},
{
"name": "Picture",
"index": "sheet_03",
"order": 2,
"status": 0
}
]
```
--------------------------------
### rangeCutBefore
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
Triggered before a range is cut. It receives the range and the data to be cut.
```APIDOC
## rangeCutBefore
### Description
Triggered before a range is cut. It receives the range and the data to be cut.
### Parameters
#### Path Parameters
- None
#### Query Parameters
- None
#### Request Body
- **range** (Array) - Optional - The range of the selection, which must be a single range.
- **data** (Object) - Optional - The data corresponding to the range of the selection to be cut.
```
--------------------------------
### sheetCreateBefore
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
Triggered before a new sheet is created. This includes the creation of pivot tables.
```APIDOC
## sheetCreateBefore
### Description
Triggered before a new sheet is created. This includes the creation of pivot tables.
### Parameters
#### Path Parameters
- None
#### Query Parameters
- None
#### Request Body
- None
```
--------------------------------
### Custom Image Upload Function
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
Implement a custom image upload handler. This function accepts a file object and should return a Promise that resolves with the uploaded image URL.
```javascript
{
uploadImage: function (file) {
return new Promise(function (resolve, reject) {
var xhr = new XMLHttpRequest();
xhr.open('POST', 'http://192.168.210.159/miniuiServer/imageUploader.php');
// 额外的请求头
var headers = {};
if (headers) {
Object.keys(headers).forEach(function (k) {
xhr.setRequestHeader(k, headers[k]);
});
}
var data = new FormData();
// 要上传的图片文件
data.append('file', file, file.name || '');
xhr.send(data);
xhr.onreadystatechange = function () {
if (xhr.readyState === 4) {
if (xhr.status === 200) {
var res = JSON.parse(xhr.responseText);
var url = res.downloadUrl;
if (url) {
resolve(url); // 给上传的后的地址
} else {
reject('image upload error');
}
} else {
reject('image upload error');
}
}
};
});
}
}
```
--------------------------------
### Default Sheet Data Configuration
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
This is the default structure for sheet data when no loadUrl or loadSheetUrl is provided. It defines the initial sheets with their names and configurations.
```json
[ { "name": "Sheet1", color: "", "status": "1", "order": "0", "data": [], "config": {}, "index":0 }, { "name": "Sheet2", color: "", "status": "0", "order": "1", "data": [], "config": {}, "index":1 }, { "name": "Sheet3", color: "", "status": "0", "order": "2", "data": [], "config": {}, "index":2 } ]
```
--------------------------------
### sheetMoveBefore
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
Triggered before a sheet is moved. It receives the index and order of the sheet.
```APIDOC
## sheetMoveBefore
### Description
Triggered before a sheet is moved. It receives the index and order of the sheet.
### Parameters
#### Path Parameters
- None
#### Query Parameters
- None
#### Request Body
- **i** (Number) - Optional - The index of the current sheet.
- **order** (Number) - Optional - The order of the current sheet.
```
--------------------------------
### sheetDeactivateBefore
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
Triggered before a sheet transitions from active to inactive state. It receives the sheet's index.
```APIDOC
## sheetDeactivateBefore
### Description
Triggered before a sheet transitions from active to inactive state. It receives the sheet's index.
### Parameters
#### Path Parameters
- None
#### Query Parameters
- None
#### Request Body
- **i** (Number) - Optional - The index of the sheet.
```
--------------------------------
### rangeCopyAfter
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
Triggered after a range is copied. It receives the range and its corresponding data.
```APIDOC
## rangeCopyAfter
### Description
Triggered after a range is copied. It receives the range and its corresponding data.
### Parameters
#### Path Parameters
- None
#### Query Parameters
- None
#### Request Body
- **range** (Object | Array) - Optional - The range of the selection, which may be multiple selections.
- **data** (Object) - Optional - The data corresponding to the range of the selection.
```
--------------------------------
### Customize Cell Right-Click Menu
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
Define which options are available in the right-click context menu for cells. This includes actions like copy, paste, insert/delete rows/columns, and formatting.
```javascript
{
copy: false, // Copy
copyAs: false, // Copy as
paste: false, // Paste
insertRow: false, // Insert row
insertColumn: false, // Insert column
deleteRow: false, // Delete selected rows
deleteColumn: false, // Delete selected columns
deleteCell: false, // Delete cell
hideRow: false, // Hide and show selected rows
hideColumn: false, // Hide and show selected columns
rowHeight: false, // Row height
columnWidth: false, // Column width
clear: false, // Clear content
matrix: false, // Matrix operation selection
sort: false, // Sort selection
filter: false, // Filter selection
chart: false, // Generate chart
image: false, // Insert image
link: false, // Insert link
data: false, // Data validation
cellFormat: false // Set cell format
}
```
--------------------------------
### rangePasteBefore
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
Triggered before a range is pasted. It receives the target range and the data to be pasted.
```APIDOC
## rangePasteBefore
### Description
Triggered before a range is pasted. It receives the target range and the data to be pasted.
### Parameters
#### Path Parameters
- None
#### Query Parameters
- None
#### Request Body
- **range** (Object | Array) - Optional - The range of the selection, which may be multiple selections.
- **data** (Object) - Optional - The data corresponding to the range of the selection to be pasted.
```
--------------------------------
### sheetHideBefore
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
Triggered before a sheet is hidden. It receives the configuration of the sheet to be hidden.
```APIDOC
## sheetHideBefore
### Description
Triggered before a sheet is hidden. It receives the configuration of the sheet to be hidden.
### Parameters
#### Path Parameters
- None
#### Query Parameters
- None
#### Request Body
- **sheet** (Object) - Optional - The configuration of the sheet to be hidden.
```
--------------------------------
### AJAX POST Request for loadUrl
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
Demonstrates the jQuery AJAX POST request format used by Luckysheet to fetch workbook configuration and cell data from a server. This is relevant when using the `loadUrl` option for large datasets.
```javascript
$.post(loadurl, {"gridKey" : server.gridKey}, function (d) {})
```
--------------------------------
### Customize Sheet Right-Click Menu
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
Configure the options available in the right-click context menu for sheet tabs. This allows customization of actions like delete, copy, rename, and color changes.
```javascript
{
delete: false, // Delete
copy: false, // Copy
rename: false, // Rename
color: false, // Change color
hide: false, // Hide, unhide
move: false, // Move left, move right
}
```
--------------------------------
### rangeCutAfter
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
Triggered after a range is cut. It receives the range and the cut data.
```APIDOC
## rangeCutAfter
### Description
Triggered after a range is cut. It receives the range and the cut data.
### Parameters
#### Path Parameters
- None
#### Query Parameters
- None
#### Request Body
- **range** (Array) - Optional - The range of the selection, which must be a single range.
- **data** (Object) - Optional - The data corresponding to the range of the selection that was cut.
```
--------------------------------
### fireMousedown
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
Custom method for cell data drill-down. This hook is mounted under options: `options.fireMousedown`.
```APIDOC
## Function fireMousedown
### Description
Custom method for cell data drill-down. This hook is mounted under options: `options.fireMousedown`.
### Type
Function
### Default Value
null
```
--------------------------------
### sheetDeleteBefore
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
Triggered before a sheet is deleted. It receives the configuration of the sheet to be deleted.
```APIDOC
## sheetDeleteBefore
### Description
Triggered before a sheet is deleted. It receives the configuration of the sheet to be deleted.
### Parameters
#### Path Parameters
- None
#### Query Parameters
- None
#### Request Body
- **sheet** (Object) - Optional - The configuration of the sheet to be deleted.
```
--------------------------------
### sheetZoomBefore
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
Triggered before a sheet's zoom level is changed. It receives the sheet's index and current zoom level.
```APIDOC
## sheetZoomBefore
### Description
Triggered before a sheet's zoom level is changed. It receives the sheet's index and current zoom level.
### Parameters
#### Path Parameters
- None
#### Query Parameters
- None
#### Request Body
- **i** (Number) - Optional - The index of the sheet.
- **zoom** (String) - Optional - The current zoom level of the sheet.
```
--------------------------------
### Image URL Handling Function
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
Process the URL of uploaded images for display. This function is useful when the upload returns a relative path that needs to be converted to a full URL for rendering.
```javascript
{
imageUrlHandle: function (url) {
// 已经是 // http data 开头则不处理
if (/^(?::\/\/|(?:http|https|data):)/i.test(url)) {
return url;
}
return location.origin + url;
}
}
```
--------------------------------
### onTogglePager
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
Callback function for pager button clicks. It returns the current page number. Refer to sPage backFun for specific parameters.
```APIDOC
## Function onTogglePager
### Description
Callback function for pager button clicks. It returns the current page number. Refer to sPage backFun for specific parameters.
### Type
Function
### Default Value
null
### Parameters
#### Page Parameter
- **page** (Object) - Optional - Returns the current pager object.
```
--------------------------------
### sheetMoveAfter
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
Triggered after a sheet is moved. It receives the index and the old and new order of the sheet.
```APIDOC
## sheetMoveAfter
### Description
Triggered after a sheet is moved. It receives the index and the old and new order of the sheet.
### Parameters
#### Path Parameters
- None
#### Query Parameters
- None
#### Request Body
- **i** (Number) - Optional - The index of the current sheet.
- **oldOrder** (Number) - Optional - The order of the current sheet before modification.
- **newOrder** (Number) - Optional - The order of the current sheet after modification.
```
--------------------------------
### rangeClearBefore
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
Triggered before a range is cleared. It receives the range and the data to be cleared.
```APIDOC
## rangeClearBefore
### Description
Triggered before a range is cleared. It receives the range and the data to be cleared.
### Parameters
#### Path Parameters
- None
#### Query Parameters
- None
#### Request Body
- **range** (Object | Array) - Optional - The range of the selection, which may be multiple selections.
- **data** (Object) - Optional - The data corresponding to the range of the selection to be cleared.
```
--------------------------------
### sheetHideAfter
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
Triggered after a sheet is hidden. It receives the configuration of the hidden sheet.
```APIDOC
## sheetHideAfter
### Description
Triggered after a sheet is hidden. It receives the configuration of the hidden sheet.
### Parameters
#### Path Parameters
- None
#### Query Parameters
- None
#### Request Body
- **sheet** (Object) - Optional - The configuration of the sheet that was hidden.
```
--------------------------------
### sheetEditColorBefore
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
Triggered before a sheet's color is edited. It receives the sheet's index and current color.
```APIDOC
## sheetEditColorBefore
### Description
Triggered before a sheet's color is edited. It receives the sheet's index and current color.
### Parameters
#### Path Parameters
- None
#### Query Parameters
- None
#### Request Body
- **i** (Number) - Optional - The index of the sheet.
- **color** (String) - Optional - The current color of the sheet.
```
--------------------------------
### rangeDeleteBefore
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
Triggered before a range is deleted. It receives the range and the data to be deleted.
```APIDOC
## rangeDeleteBefore
### Description
Triggered before a range is deleted. It receives the range and the data to be deleted.
### Parameters
#### Path Parameters
- None
#### Query Parameters
- None
#### Request Body
- **range** (Array) - Optional - The range of the selection, which must be a single range.
- **data** (Object) - Optional - The data corresponding to the range of the selection to be deleted.
```
--------------------------------
### sheetDeleteAfter
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
Triggered after a sheet is deleted. It receives the configuration of the deleted sheet.
```APIDOC
## sheetDeleteAfter
### Description
Triggered after a sheet is deleted. It receives the configuration of the deleted sheet.
### Parameters
#### Path Parameters
- None
#### Query Parameters
- None
#### Request Body
- **sheet** (Object) - Optional - The configuration of the sheet that was deleted.
```
--------------------------------
### rangePullBefore
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
Triggered before a range pull operation. It receives the current range.
```APIDOC
## rangePullBefore
### Description
Triggered before a range pull operation. It receives the current range.
### Parameters
#### Path Parameters
- None
#### Query Parameters
- None
#### Request Body
- **range** (Array) - Optional - The current range of the selection, which must be a single range.
```
--------------------------------
### JSON Response Structure for loadSheetUrl
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
Presents the expected JSON string format for the response from the `loadSheetUrl` endpoint, providing cell data for specified sheets. The data is organized by sheet index.
```json
{
"sheet_01": [
{
"r": 0,
"c": 0,
"v": { "v": 1, "m": "1", "ct": { "fa": "General", "t": "n" } }
}
],
"sheet_02": [
{
"r": 0,
"c": 0,
"v": { "v": 1, "m": "1", "ct": { "fa": "General", "t": "n" } }
}
],
"sheet_03": [
{
"r": 0,
"c": 0,
"v": { "v": 1, "m": "1", "ct": { "fa": "General", "t": "n" } }
}
]
}
```
--------------------------------
### AJAX POST Request for loadSheetUrl
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
Shows the jQuery AJAX POST request format for fetching cell data of other sheets asynchronously using `loadSheetUrl`. It includes parameters for `gridKey` and a comma-separated list of sheet indices.
```javascript
$.post(loadSheetUrl, {"gridKey" : server.gridKey, "index": sheetindex.join(",")}, function (d) {})
```
--------------------------------
### rangeDeleteAfter
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
Triggered after a range is deleted. It receives the range and the deleted data.
```APIDOC
## rangeDeleteAfter
### Description
Triggered after a range is deleted. It receives the range and the deleted data.
### Parameters
#### Path Parameters
- None
#### Query Parameters
- None
#### Request Body
- **range** (Array) - Optional - The range of the selection, which must be a single range.
- **data** (Object) - Optional - The data corresponding to the range of the selection that was deleted.
```
--------------------------------
### rangePasteAfter
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
Triggered after a range is pasted. It receives the range, the original data, and the pasted data.
```APIDOC
## rangePasteAfter
### Description
Triggered after a range is pasted. It receives the range, the original data, and the pasted data.
### Parameters
#### Path Parameters
- None
#### Query Parameters
- None
#### Request Body
- **range** (Object | Array) - Optional - The range of the selection, which may be multiple selections.
- **originData** (Object) - Optional - The data corresponding to the range of the selection to be pasted.
- **pasteData** (Object) - Optional - The data to be pasted.
```
--------------------------------
### sheetEditNameBefore
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
Triggered before a sheet's name is edited. It receives the sheet's index and current name.
```APIDOC
## sheetEditNameBefore
### Description
Triggered before a sheet's name is edited. It receives the sheet's index and current name.
### Parameters
#### Path Parameters
- None
#### Query Parameters
- None
#### Request Body
- **i** (Number) - Optional - The index of the sheet.
- **name** (String) - Optional - The current name of the sheet.
```
--------------------------------
### sheetActivate
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
Triggered before a sheet is activated. It receives the sheet's index and flags indicating if it's a pivot table or a new sheet.
```APIDOC
## sheetActivate
### Description
Triggered before a sheet is activated. It receives the sheet's index and flags indicating if it's a pivot table or a new sheet.
### Parameters
#### Path Parameters
- None
#### Query Parameters
- None
#### Request Body
- **i** (Number) - Optional - The index of the sheet.
- **isPivotInitial** (Boolean) - Optional - Whether the activated sheet is a pivot table.
- **isNewSheet** (Boolean) - Optional - Whether the activated sheet is a newly created sheet.
```
--------------------------------
### Handle Image Deletion After
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
This hook is triggered after an image is deleted. It can be used to send a request to delete the image file from the server if custom image upload handling is implemented.
```javascript
{
hook: {
imageDeleteAfter: function (imageItem) {
var src = imgItem.src;
$.post('/rest/file/deletebyurl', {downloadUrl: src});
}
}
}
```
--------------------------------
### sheetEditColorAfter
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
Triggered after a sheet's color is edited. It receives the sheet's index and the old and new colors.
```APIDOC
## sheetEditColorAfter
### Description
Triggered after a sheet's color is edited. It receives the sheet's index and the old and new colors.
### Parameters
#### Path Parameters
- None
#### Query Parameters
- None
#### Request Body
- **i** (Number) - Optional - The index of the sheet.
- **oldColor** (String) - Optional - The sheet color before modification.
- **newColor** (String) - Optional - The sheet color after modification.
```
--------------------------------
### sheetZoomAfter
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
Triggered after a sheet's zoom level is changed. It receives the sheet's index and the old and new zoom levels.
```APIDOC
## sheetZoomAfter
### Description
Triggered after a sheet's zoom level is changed. It receives the sheet's index and the old and new zoom levels.
### Parameters
#### Path Parameters
- None
#### Query Parameters
- None
#### Request Body
- **i** (Number) - Optional - The index of the sheet.
- **oldZoom** (String) - Optional - The sheet zoom level before modification.
- **newZoom** (String) - Optional - The sheet zoom level after modification.
```
--------------------------------
### rangePullAfter
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
Triggered after a range pull operation. It receives the range after the pull.
```APIDOC
## rangePullAfter
### Description
Triggered after a range pull operation. It receives the range after the pull.
### Parameters
#### Path Parameters
- None
#### Query Parameters
- None
#### Request Body
- **range** (Array) - Optional - The range of the selection after the pull, which must be a single range.
```
--------------------------------
### sheetEditNameAfter
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
Triggered after a sheet's name is edited. It receives the sheet's index and the old and new names.
```APIDOC
## sheetEditNameAfter
### Description
Triggered after a sheet's name is edited. It receives the sheet's index and the old and new names.
### Parameters
#### Path Parameters
- None
#### Query Parameters
- None
#### Request Body
- **i** (Number) - Optional - The index of the sheet.
- **oldName** (String) - Optional - The sheet name before modification.
- **newName** (String) - Optional - The sheet name after modification.
```
--------------------------------
### rangeClearAfter
Source: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html
Triggered after a range is cleared. It receives the range and the cleared data.
```APIDOC
## rangeClearAfter
### Description
Triggered after a range is cleared. It receives the range and the cleared data.
### Parameters
#### Path Parameters
- None
#### Query Parameters
- None
#### Request Body
- **range** (Object | Array) - Optional - The range of the selection, which may be multiple selections.
- **data** (Object) - Optional - The data corresponding to the range of the selection that was cleared.
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.