I don’t understand why a filter should change or affect onto the code.
Just right from the beginning.
- You have a DATABASE where you have some items in it.
- This DATABASE is connected with a DATASET. (let us say all settings are ok).
- Now the action which you want to achieve, let us say the following…
a) You want to count the items right from the beginning when page has loaded.
b) You want to show the result of this counter in a textfield (let us call it “TXTcounter” ).
c) You want to show up a Textfield when some special counting-numbers are given, let us say you have 448 -items in your DATABASE.
Now you start coding (after you have setted-up and connected your DATASET correctly).
- When page is ready…
$w.onReady (function() {
})
- When page is ready & dataset is also ready…
$w.onReady (function() {
$w("#dataset1").onReady(() => {
})
})
- When page & dataset is ready —> get the number of items in my data-collection…
Of course, first we define a new variable (“count”) and then fill it with the counting result of the amount of database-items. And we also do not forget to make a little CONSOLE-LOG !
$w.onReady (function() {
$w("#dataset1").onReady(() => {
let count = $w("#dataset1").getTotalCount()
console.log("My total items in DB = " + count)
})
})
- Now we want to fill the Textfield —> “TXTcounter” with the founded counting result…
OKEYYYYYY, well done.
Then i stop here
. I just wanted to show you the way, how i would try to solve the problem. But you got it already!
As i told you —> NEVER GIVE UP !![]()