Dear All,
I have:
5 Dataset (Dataset1, Dataset2, Dataset3, Dataset4, Dataset5) all connected to the same collection
5 Strip (StripItem1, StripItem2, StripItem3, StripItem4, StripItem5) all collapsed and hidden
On the collection there is Boolean field ‘Published’
What I tried to do is if the ‘Published’ is TRUE the Strip is shown
I wrote the following, but it does not work
$w.onReady(function (index) {
[1,2,3,4,5]
.filter(id => id !== index)
.forEach(id => {
let $currentItem = $w('#Dataset' + index).getCurrentItem();
let $StripItem = $w('#StripItem' + index);
if ($currentItem.published === true) {$StripItem.expand(); $StripItem.show()}
})
});
Thank you for your help.
Best regards,
Domivax
But onReady doesn't have any arguments
$w.onReady(function (index) { console.log(index); // undefined });
And string + undefined return:
'#Dataset' + index === '#Datasetundefined'