mazel
September 1, 2020, 9:14pm
1
Hi, everybody!
Is it possible in WIX save some screen elements config for each client?
(I mean on each commuter or phone of visitors, not logining - anonymous viewers)
For example:
Just BOX with TEXT and 2 buttons: HIDE and SHOW this BOX with text…
Visitor open dynamic page first time, read Text Information and Click “Hide”…
And close page. And open another Dynamic Page in 5 minutes…
Is it possible save state of box HIDE…
Because WIX accessible from many different devices I think it cannot be Just Cookie or…
Please, help
Sincerely, Misha
You could use the local storage…
https://www.wix.com/corvid/reference/wix-storage/introduction
Or just create an OPTIONS-DATABASE, where you store all saved-options of your site.
Take also a look at this example here…
https://russian-dima.wixsite.com/meinewebsite/switch-safe-function
Working code on this site…
import wixData from 'wix-data';
//------------------------------------ USER-DATA-INTERFACE -----------------------------------------
//var DATABASE = "Switch-Save-Function"
var DATASET = "dataset1"
//------------------------------------ USER-DATA-INTERFACE -----------------------------------------
var currentItemIndex
$w.onReady(function () {
$w("#"+DATASET).onReady( () => {
$w('#TXTmember').text="Member-"+currentItemIndex
$w('#BTNsave').onClick(()=>{
if ($w('#BTNswitch1').checked===true){$w("#"+DATASET).setFieldValue("btnStatus", true);}
else {$w("#"+DATASET).setFieldValue("btnStatus", false);}
$w("#"+DATASET).save();
})
$w('#BTNnext').onClick(()=>{console.log("NEXT")
currentItemIndex = $w("#"+DATASET).getCurrentItemIndex()+1
console.log(currentItemIndex)
$w('#TXTmember').text="Member-"+currentItemIndex
})
$w('#BTNprevious').onClick(()=>{console.log("PREVIOUS")
currentItemIndex = $w("#"+DATASET).getCurrentItemIndex()+1
console.log(currentItemIndex)
$w('#TXTmember').text="Member-"+currentItemIndex
})
})
});
mazel
September 2, 2020, 3:07am
3
Thank You very much, Dima!
It’s working on my Windows PC and Android Phone.
Glad to hear that it worked .
Do not forget to like it if you really liked it