VSeed, an elegant data composer, transforming complexity into simplicity.
!!!###!!!title=excel keyboard interaction alignment——VisActor/VTable tutorial documents!!!###!!!!!!###!!!description=`ExcelEditCellKeyboardPlugin` is an extension component of VTable, which can achieve the function of aligning the keyboard behavior of editing cells with Excel.!!!###!!!
ExcelEditCellKeyboardPlugin is an extension component of VTable, which can achieve the function of aligning the keyboard behavior of editing cells with Excel.
Plugin Implementation Ability Description
VTable has a lot of keyboard event responses, which can be referred to in the Shortcut chapter.
These configuration items can meet the requirements of most editing table keyboard responses, but to better align with the keyboard behavior of Excel, we have developed the ExcelEditCellKeyboardPlugin plugin, which can achieve the function of aligning the keyboard behavior of editing cells with Excel.
Basic Usage of Plugin
const excelEditCellKeyboardPlugin = new VTablePlugins.ExcelEditCellKeyboardPlugin();
The constructor of ExcelEditCellKeyboardPlugin can accept a configuration item, the type of which is IExcelEditCellKeyboardPluginOptions, as follows:
export type IExcelEditCellKeyboardPluginOptions = {
id?: string;
/** The list of keyboard events that the plugin responds to */ responseKeyboard?: ExcelEditCellKeyboardResponse[];
/** Whether the delete ability only applies to editable cells */ deleteWorkOnEditableCell?: boolean;
/** When deleting a range, call the batch API to aggregate into one change_cell_values event */ batchCallChangeCellValuesApi?: boolean;
};
The batchCallChangeCellValuesApi option is used to control the deletion behavior for multiple selected ranges. When enabled, the plugin will call changeCellValuesByRanges once to update the selected ranges, so that change_cell_values is fired as a single aggregated event instead of being triggered per-cell.
The responseKeyboard configuration item is used to configure the list of keyboard events that the plugin responds to, the value type of which is ExcelEditCellKeyboardResponse, as follows: