Posted 20 May 2025, 4:54 am EST
- Updated 20 May 2025, 4:59 am EST
Hi,
Apologies for the delay caused over the weekend.
It is possible to open the Print Menu in a single action by using an external button. Please refer to the below code snippet that illustrates the same:
document.getElementById("printBtn").addEventListener("click", (e) => {
let canShowMenu = false;
if(!designer.getData("FileMenu_show")) canShowMenu = true;
if(canShowMenu) {
const fileMenuSettings = designer.getData("fileMenuSetting");
if(!fileMenuSettings || !fileMenuSettings.activeCategory_main || fileMenuSettings.activeCategory_main !== "Print") {
designer.setData("fileMenuSetting", {...fileMenuSettings, "activeCategory_main": "Print"});
}
}
designer.setData("FileMenu_show", canShowMenu);
});
You can further refer to the attached code sample that uses the above code snippet and opens the Print Menu using an external button (see below).
Please note that the command manager is specific to SpreadJS and is not meant to alter the designer-specific operations. Therefore, the command manager’s execute method will not trigger the Print Menu open action.
Please feel free to reach out if you encounter any further issues or require additional guidance.
Sample: https://jscodemine.mescius.io/share/7wPiO0lM5U23fouQlOiZtA/?defaultOpen={"OpenedFileName"%3A["%2Findex.html"%2C"%2Fapp.js"]%2C"ActiveFile"%3A"%2Fapp.js"}
Gif: 
Regards,