Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
We support the following JS APIs for the Highlight feature
xs.sheet.showHighlights(style)
// the parameter is:
style: the style for highlight, currently only supports color
for example: {'color':'rgba(85, 57, 47, 0.08)'}
xs.sheet.updateHighlightStyle(style)
// the parameter is:
style: the style for highlight, currently only supports color
for example: {'color':'rgba(85, 57, 47, 0.08)'}
xs.sheet.hideHighlights()
xs.sheet.addHighlightText(row, col, startposition, endposition)
// the parameters are:
row: row index
col: column index
startposition: highlight start position in cell text
endposition: highlight end position in cell text
// it supports multiple range positions inside one cell
xs.sheet.removeHighlightText(row, col, startposition, endposition)
// the parameters are:
row: row index
col: column index
startposition: highlight start position in cell text
endposition: highlight end position in cell text
xs.sheet.getHighlightTexts()
xs.sheet.addHighlightRange(sri, sci, eri, eci)
// the parameters are:
sri: start row index of cell range
sci: start column index of cell range
eri: end row index of cell range
eci: end column index of cell range
xs.sheet.removeHighlightRange(sri, sci, eri, eci)
// the parameters are:
sri: start row index of cell range
sci: start column index of cell range
eri: end row index of cell range
eci: end column index of cell range
xs.sheet.getHighlightRanges()
xs.sheet.setHighlightInverseRange(sri, sci, eri, eci)
// the parameters are:
sri: start row index of cell range
sci: start column index of cell range
eri: end row index of cell range
eci: end column index of cell range
xs.sheet.removeHighlightInverseRange()
xs.sheet.getHighlightInverseRange()
xs.sheet.addHighlightShape(shapeid)
// the parameters are:
shapeid: the id of the shape, can be found in xs.sheet.data.shapes
xs.sheet.removeHighlightShape(shapeid)
// the parameters are:
shapeid: the id of the shape, can be found in xs.sheet.data.shapes
xs.sheet.getHighlightShapes()
"TextBox", in the active worksheetxs.sheet.addHighlightTextBox(shapeid, startposition, endposition)
// the parameters are:
shapeid: the id of the shape, can be found in xs.sheet.data.shapes whose type is 'TextBox'
startposition: highlight start position in the text of the TextBox
endposition: highlight end position in the text of the TextBox
// it supports multiple range positions inside one TextBox
"TextBox", in the active worksheetxs.sheet.removeHighlightTextBox(shapeid, startposition, endposition)
// the parameters are:
shapeid: the id of the shape, can be found in xs.sheet.data.shapes whose type is 'TextBox'
startposition: highlight start position in the text of the TextBox
endposition: highlight end position in the text of the TextBox
// it supports multiple range positions inside one TextBox
xs.sheet.addHighlightImage(imageid)
// the parameters are:
imageid: the id of the image, can be found in xs.sheet.data.images
xs.sheet.removeHighlightImage(imageid)
// the parameters are:
imageid: the id of the image, can be found in xs.sheet.data.images
xs.sheet.getHighlightImages()
xs.sheet.setHighlightAll(isHighlightAll, isRerender = true)
// the parameters are:
isHighlightAll: true or false, whether to highlight all
isRerender: true or false, whether to re-render
xs.sheet.setCustomHighlightImgFunc(func)
// the parameters are:
func: the custom highlight image function; it shall take two parameters, the first is isHighlight, the second one is the Fabric image object
// we use Fabric.js to manage image objects; please refer to http://fabricjs.com/image-filters for more information
// below is an example for the declared function:
const customHighlightImage = (isHighlight, imgObj) => {
imgObj.filters[0] = isHighlight ? new fabric.Image.filters.Sepia() : false;
imgObj.applyFilters();
}
xs.sheet.clearHighlights()
TextBox is a special kind of shape whose type property is "TextBox".
For example, the code below will show which shape is a TextBox:
for (let shape of xs.sheet.data.shapes) {
if (shape.type === 'TextBox') {
console.log(shape.id + ' is a textbox');
}
}
addHighlight(startposition, endposition)
// the parameters are:
startposition: highlight start position in the TextBox
endposition: highlight end position in the TextBox
// For example, we assume shape 0 is a TextBox object
const textbox = xs.sheet.data.shapes[0];
// First we shall add the highlight shape to enable highlighting for the TextBox shape object; it supports multiple range positions
xs.sheet.addHighlightShape(textbox.id);
textbox.addHighlight(5, 10);
textbox.addHighlight(18, 28);
removeHighlight(startposition, endposition)
// the parameters are:
startposition: highlight start position in the TextBox
endposition: highlight end position in the TextBox
// For example, we assume shape 0 is a TextBox object
const textbox = xs.sheet.data.shapes[0];
textbox.removeHighlight(5, 10);
getHighlight()
// For example, we assume shape 0 is a TextBox object
const textbox = xs.sheet.data.shapes[0];
textbox.getHighlight();
You can find more in our GitHub demo page: https://github.com/aspose-cells/Aspose.Cells.Grid-for-Java/blob/main/Examples.GridJs/src/main/resources/templates/index.html
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.