Hey
So I have a dynamic page, and I want a strip being expanded or collapsed be conditional on if the item meets certain criteria
ie. Its a dynamic page relating to a property
The type of property is stored in a text field " typeOfAccommodation" for each item.
I want to show the strip #hostelstrip and hide the other strip #columnStrip12 if it’s a Hostel.
I wrote this code below
and I put
checkproptype() under the onReady thing along with loads of other stuff as below
But it’s not wrking?? Anyone help me asto why
$w . onReady ( function () {
checkproptype ()
…
}
function checkproptype ( ) {
**let** proptype = $w ( '#dynamicDataset' ). getCurrentItem (). typeOfAccommodation
**if** ( proptype == "Hostel" ) {
$w ( '#hostelstrip' ). expand ;
$w ( '#columnStrip12' ). collapse ;
} **else** {
$w ( '#hostelstrip' ). collapse ;
$w ( '#columnStrip12' ). expand ;
}
}