Mx Natives ES8 javascript: how to select an element by classname?
0
How to select a Dom-element by its class name in Mendix Native's ES8 javascript? A simple javascript like this: export async function ShortcutKeys_ListenAndStartANanoflow(myNanoflowName) { // BEGIN USER CODE for (const i of document.querySelectorAll(".ShortcutKeyF9")){ console.log(i.innerHTML); } fails on the ‘document’ and is giving this error: “An error occurred while executing an action of WMS_ScanModule.Test_AppEventWidget.appEvents1: Can't find variable: document “ Also tried: ”this.querySelectorAll” but that fails with “this.querySelectorAll' is undefined)”
asked
Tim v Steenbergen
2 answers
1
Unfortunately, native doesn't have the concept of HTML nodes and selector, so we cannot reach fields inside.