Hey Guys!
I want to display 3 counters on my page, it should count from zero to something to show how many customers we have etc.
I copied this code from a forum discussion:
The first counter works fine, but i’m struggling with the 2nd and the 3rd. Someone with more coding experience, please provide me a working code, so i just have to make the textboxes and modify the numbers.
Thanks for your help.
What i have been trying to do, and has not worked so far is something like this:
import wixData from ‘wix-data’ ;
$w.onReady( function () {
wixData.query( “DADOS” ) // DADOS is my database
.eq( “teusmov” ) // teusmov is a column in my database with a number
.find()
.then((results)=> { let item = results.items[ 0 ];
$w( " #text38 ").text = item.toString();
});
});
I am trying to get the number on “teusmov” column and display it on " #text38 ".
This is the challenge (for me, a total newbie to corvid/java).
Wish you well.
import wixData from ‘wix-data’ ;
$w.onReady( function () {
wixData.query( “DADOS” ) // DADOS is my database
// you need to remove this .eq(" teusmov") from here
.find() //this will return all records in the dataset
.then((results)=> {
let items = results.items; //this will store the rows in an items variable let item=items[ 0 ]; //this will store the first row in the item variable let teusmov = item. teusmov ; //this will store the teusmov value you want in the teusmov variable
$w( " #text38 " ).text = teusmov .toString(); //then use the teusmov variable
});
});
import wixData from ‘wix-data’ ;
$w.onReady( function () {
wixData.query( “DADOS” ) // DADOS is my database
// you need to remove this .eq(" teusmov") from here
.find() //this will return all records in the dataset
.then((results)=> {
let items = results.items; //this will store the rows in an items variable
let item=items[ 0 ]; //this will store the first row in an item variable
let teusmov = item. teusmov ; //this will store the teusmov value you want in a teusmov variable
$w( " #text38 " ).text = teusmov .toString(); //then use the teusmov variable to send to the textbox
});
});