Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Table of Contents
Use your mouse pointer to point to a cell. Click a cell to select it. The selected cell is highlighted by a bold rectangle.
How it works:
When the user clicks a cell, the event is handled by a JavaScript callback function that is attached to the PrimeFaces component.
var columnId = $(this).find('.ui-cell-editor-input input').attr('data-columnid');
var rowId = $(this).find('.ui-cell-editor-input input').attr('data-rowid');
var clientId = $(this).find('.ui-cell-editor').attr('id');
PF('currentColumnIdValue').jq.val(columnId);
PF('currentRowIdValue').jq.val(rowId);
PF('currentCellClientIdValue').jq.val(clientId);
if ($(this).find('.ui-cell-editor-output div').hasClass('b')) {
PF('boldOptionButton').check();
} else {
PF('boldOptionButton').uncheck();
}
if ($(this).find('.ui-cell-editor-output div').hasClass('i')) {
PF('italicOptionButton').check();
} else {
PF('italicOptionButton').uncheck();
}
if ($(this).find('.ui-cell-editor-output div').hasClass('u')) {
PF('underlineOptionButton').check();
} else {
PF('underlineOptionButton').uncheck();
}
PF('fontOptionSelector').selectValue($(this).find('.ui-cell-editor-output div').css('font-family').slice(1, -1));
PF('fontSizeOptionSelector').selectValue($(this).find('.ui-cell-editor-output div')[0].style.fontSize.replace('pt', ''));
['al', 'ac', 'ar', 'aj'].forEach(function(v) {
if ($(this).find('.ui-cell-editor-output div').hasClass(v)) {
// TODO: save the value to PF('alignOptionSelector');
}
});
PF('currentColumnWidthValue').jq.val($(this).width());
PF('currentRowHeightValue').jq.val($(this).height());
$($this.selectedCell).removeClass('sheet-selected-cell');
$(this).addClass('sheet-selected-cell');
$this.selectedCell = this;To delete a cell:
The editor will delete the selected cell. The adjacent cells will be automatically shifted either horizontally or vertically to adjust the space.
How it works:
The Shift Cells Up and Shift Cells Left are handled by the JSF backend bean WorksheetView. The source code of the respective methods is as follows:
public void removeCellShiftUp() {
if (!isLoaded()) {
return;
}
getAsposeWorksheet().getCells().deleteRange(currentRowId, currentColumnId, currentRowId, currentColumnId, com.aspose.cells.ShiftType.UP);
purge();
} public void removeCellShiftLeft() {
if (!isLoaded()) {
return;
}
getAsposeWorksheet().getCells().deleteRange(currentRowId, currentColumnId, currentRowId, currentColumnId, com.aspose.cells.ShiftType.LEFT);
purge();
}To clear a cell:
The editor will clear the selected cell.
How it works:
The Formats, Contents, and Both options are handled by the JSF backend bean WorksheetView. The source code of the respective methods is as follows:
public void clearCurrentCellFormatting() {
if (!isLoaded()) {
return;
}
getAsposeWorksheet().getCells().clearFormats(currentRowId, currentColumnId, currentRowId, currentColumnId);
reloadCell(currentColumnId, currentRowId);
RequestContext.getCurrentInstance().update(currentCellClientId);
} public void clearCurrentCellContents() {
if (!isLoaded()) {
return;
}
getAsposeWorksheet().getCells().clearContents(currentRowId, currentColumnId, currentRowId, currentColumnId);
reloadCell(currentColumnId, currentRowId);
RequestContext.getCurrentInstance().update(currentCellClientId);
} public void clearCurrentCell() {
if (!isLoaded()) {
return;
}
getAsposeWorksheet().getCells().clearRange(currentRowId, currentColumnId, currentRowId, currentColumnId);
reloadCell(currentColumnId, currentRowId);
RequestContext.getCurrentInstance().update(currentCellClientId);
}Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.