@ -636,7 +636,7 @@ The hook functions are uniformly configured under ʻoptions.hook`, and configura
- Usage: Triggered before the cell is rendered, `return false` will not render the cell
- Usage: Triggered before the cell is rendered, `return false` will not render the cell
- Parameter:
- Parameter:
- {Object} [cell]:Cell object
- {Object} [cell]:Cell object
- {Object} [postion]:
- {Object} [posi tion]:
+ {Number} [r]: The row number of the cell
+ {Number} [r]: The row number of the cell
+ {Number} [c]: The column number of the cell
+ {Number} [c]: The column number of the cell
+ {Number} [start_r]: The horizontal coordinate of the upper left corner of the cell
+ {Number} [start_r]: The horizontal coordinate of the upper left corner of the cell
@ -654,7 +654,7 @@ The hook functions are uniformly configured under ʻoptions.hook`, and configura
- Usage: Triggered after the cell rendering ends, `return false` will not render the cell
- Usage: Triggered after the cell rendering ends, `return false` will not render the cell
- Parameter:
- Parameter:
- {Object} [cell]: Cell object
- {Object} [cell]: Cell object
- {Object} [postion]:
- {Object} [posi tion]:
+ {Number} [r]: The row number of the cell
+ {Number} [r]: The row number of the cell
+ {Number} [c]: The column number of the cell
+ {Number} [c]: The column number of the cell
+ {Number} [start_r]: The horizontal coordinate of the upper left corner of the cell
+ {Number} [start_r]: The horizontal coordinate of the upper left corner of the cell
@ -671,9 +671,9 @@ The hook functions are uniformly configured under ʻoptions.hook`, and configura
```js
```js
luckysheet.create({
luckysheet.create({
hook: {
hook: {
cellRenderAfter: function (cell, postion, sheetFile, ctx) {
cellRenderAfter: function (cell, posi tion, sheetFile, ctx) {
var r = postion.r;
var r = posi tion.r;
var c = postion.c;
var c = posi tion.c;
if (r === 0 & & c === 3) { // Specify to process cell D1
if (r === 0 & & c === 3) { // Specify to process cell D1
if (!window.storeUserImage) {
if (!window.storeUserImage) {
window.storeUserImage = {}
window.storeUserImage = {}
@ -708,20 +708,20 @@ The hook functions are uniformly configured under ʻoptions.hook`, and configura
if (img.complete) { //Direct rendering that has been loaded
if (img.complete) { //Direct rendering that has been loaded
ctx.drawImage(img, postion.start_c, postion.start_r, 10, 10);
ctx.drawImage(img, posi tion.start_c, posi tion.start_r, 10, 10);
} else {
} else {
img.onload = function () {
img.onload = function () {
ctx.drawImage(img, postion.start_c, postion.start_r, 10, 10);
ctx.drawImage(img, posi tion.start_c, posi tion.start_r, 10, 10);
}
}
}
}
if (imgRight.complete) {
if (imgRight.complete) {
ctx.drawImage(imgRight, postion.end_c - 10, postion.end_r - 10, 10, 10);
ctx.drawImage(imgRight, posi tion.end_c - 10, posi tion.end_r - 10, 10, 10);
} else {
} else {
imgRight.onload = function () {
imgRight.onload = function () {
ctx.drawImage(imgRight, postion.end_c - 10, postion.end_r - 10, 10, 10);
ctx.drawImage(imgRight, posi tion.end_c - 10, posi tion.end_r - 10, 10, 10);
}
}
}
}
@ -751,7 +751,7 @@ The hook functions are uniformly configured under ʻoptions.hook`, and configura
- Usage: Triggered before the row header cell is rendered, `return false` will not render the row header
- Usage: Triggered before the row header cell is rendered, `return false` will not render the row header
- Parameter:
- Parameter:
- {String} [rowNum]: Row number
- {String} [rowNum]: Row number
- {Object} [postion]:
- {Object} [posi tion]:
+ {Number} [r]: The row number of the cell
+ {Number} [r]: The row number of the cell
+ {Number} [top]: The vertical coordinate of the upper left corner of the cell
+ {Number} [top]: The vertical coordinate of the upper left corner of the cell
+ {Number} [width]: Cell width
+ {Number} [width]: Cell width
@ -766,7 +766,7 @@ The hook functions are uniformly configured under ʻoptions.hook`, and configura
- Usage: Triggered after the row header cell is rendered, `return false` will not render the row header
- Usage: Triggered after the row header cell is rendered, `return false` will not render the row header
- Parameter:
- Parameter:
- {String} [rowNum]: Row number
- {String} [rowNum]: Row number
- {Object} [postion]:
- {Object} [posi tion]:
+ {Number} [r]: The row number of the cell
+ {Number} [r]: The row number of the cell
+ {Number} [top]: The vertical coordinate of the upper left corner of the cell
+ {Number} [top]: The vertical coordinate of the upper left corner of the cell
+ {Number} [width]: Cell width
+ {Number} [width]: Cell width
@ -781,7 +781,7 @@ The hook functions are uniformly configured under ʻoptions.hook`, and configura
- Usage: Triggered before the column header cell is rendered, `return false` will not render the column header
- Usage: Triggered before the column header cell is rendered, `return false` will not render the column header
- Parameter:
- Parameter:
- {Object} [columnAbc]: Column header characters
- {Object} [columnAbc]: Column header characters
- {Object} [postion]:
- {Object} [posi tion]:
- {Number} [c]: The column number of the cell
- {Number} [c]: The column number of the cell
- {Number} [left]: The horizontal coordinate of the upper left corner of the cell
- {Number} [left]: The horizontal coordinate of the upper left corner of the cell
- {Number} [width]: Cell width
- {Number} [width]: Cell width
@ -796,7 +796,7 @@ The hook functions are uniformly configured under ʻoptions.hook`, and configura
- Usage: Triggered after the column header cell is rendered, `return false` will not render the column header
- Usage: Triggered after the column header cell is rendered, `return false` will not render the column header
- Parameter:
- Parameter:
- {Object} [columnAbc]: Column header characters
- {Object} [columnAbc]: Column header characters
- {Object} [postion]:
- {Object} [posi tion]:
- {Number} [c]: The column number of the cell
- {Number} [c]: The column number of the cell
- {Number} [left]: The horizontal coordinate of the upper left corner of the cell
- {Number} [left]: The horizontal coordinate of the upper left corner of the cell
- {Number} [width]: Cell width
- {Number} [width]: Cell width