<div id="mydiv" class="row" dmx-show="pageLoaded.value==1">
I want to show this <div>
once a certain Javascript code (unrelated to Wappler) executes succesfully, at which point I want to make pageLoaded.value = 1
.
For testing purposes, this variable is set to 1 by default:
<dmx-value id="pageLoaded" dmx-bind:value="1"></dmx-value>
The aim is to make it hide by doing pageLoaded.value = 0
If I do this:
dmx.app.data.content.pageLoaded = 0;
The div was supposed to hide, but that doesn’t happen, unless I execute the following line after:
dmx.app.set('pageLoaded', 0);
But this ‘pageLoaded’ variable didn’t seem to exist, because dmx.app.get returned undefined
before the set. So, the dmx.app.set is there just to refresh the view (i.e.: make dmx-show update), which looks like a bit ugly solution