One type of cell drop-down in SpreadJS is the calculator. When added to the workbook as a cell style with JavaScript code, the calculator provides users with a means to do quick calculation and have that result be displayed in the cell. The below spreadsheet shows how that works.
Drop-downs provide a developer the ability to add a drop-down menu with specific properties to cells in a workbook. These drop-down menus don't require any extra code other than simply specifying which one to use for the drop-down menu.
SpreadJS has 9 different kinds of drop-downs, and this demo shows how to use the Calculator.
You can use calculator drop-down with the following code :
// The way of click the dropdown icon to open calculator.
let style = new GC.Spread.Sheets.Style();
style.cellButtons= [{
imageType: GC.Spread.Sheets.ButtonImageType.dropdown,
command: "openCalculator",
}
];
sheet.setStyle(1, 0, style);
sheet.setText(0, 0, "Calculator");
// The way just open calculator with command rather then clicking the dropdown button.
spread.commandManager().execute({cmd:"openCalculator",row:5,col:5,sheetName:"Sheet1"});
Submit and view feedback for