Posted 3 May 2022, 8:04 pm EST
Hey Team,
i have set several custom commands for my app. Now i have the problem after some routine i want to execute a set command without needing the client click on the followup-button.
I tried with clicking it via queryselector, which worked perfectly fine, but i realized that if the tab has never opened the button doesn’t exist at all, which could cause some issues.
So now i though about executing the command via the command i set in commandmap.
var spread = GC.Spread.Sheets.findControl(document.getElementById("ss"));
spread.commandManager().execute({cmd: "dataCheck"})
Nothing happened, since it doesn’t exist in there.
So is there a way to execute this codevise:
var checkData = {
title: window.dict.com_REM_Ti[language],
text: window.dict.com_REM_Te[language],
iconClass: "cmdCheckData",
bigButton: true,
commandName: "checkData",
execute: async (context, propertyName) => {
//Stuff i want to execute
}
}
//config for init spread
config.commandmap.push(checkData)
var ribbonDC = {
"id": "RegEx",
"text": "Datacheck",
"buttonGroups": [
{
"label": window.dict.conf_test_REM_la[language],
"thumbnailClass": "",
"commandGroup": {
"children": [
{
"commands": [
"assignFieldToColumn",
"checkData",
"showError"
]
}
]
}
}
]
}
config.ribbon.unshift(ribbonDC)
I hope u can help me. If you need some more information, just tell me.
Regards
Maik-