Dropdown Order for expand() when added to a repeater?

Hi guys,

I have a repeater in which a dropdown is added to it-
Also there is a text box (I hasn’t displayed it in the pic)

I want that if a user choose Customer Complaint option from dropdown a text box should expand but is not working. When I console log the value, the value it appear is blank (nothing) that means my code is not able to recognises the value passed by the dropdown.

Console -

Code -

export function dropdown1_change(event) {
 console.log($w('#dropdown1').value);
 if ($w('#dropdown1').value === 'Customer Complaint') {
    $w('#textBox1').expand();
  }
 else if ($w('#dropdown1').value !== 'Customer Complaint'){
    $w('#textBox1').collapse();
  }
}

Help Please!!
Its urgent.

Thanks in Advance.


I have use the same code for a self made form and it works🤔
Problem is with dropdown to repeater compatibility😬


Maybe used the selected label instead of the selected value

  • have a look at the property panel and make sure the onChange listener is there.
  • If it’s a repeater you should use an event listener that fits to a repeater item and to the general $w.element.

I have checked the first two points and there is no such problem.
Would you please explain this solution.

If it’s a repeater you should use an event listener that fits to a repeater item and to the general $w.element.

I am new to javascript :slightly_frowning_face:

@rinshulgoel see:
https://www.wix.com/corvid/reference/$w/repeater/onitemready

This is the end code-

$w.onReady( function () {
$w(“#dropdown1”).onClick( (event) => {
let $item = $w.at(event.context);
let clickedItemData = $item(“#dropdown1”).value;
if(clickedItemData === “Customer Complaint”) {
$(“#textBox1”).expand();
}else{
$(“#textBox1”).collapse();
}
} );
} );

If you want where I got this-
https://www.wix.com/corvid/reference/$w/repeater/introduction#$w_repeater_introduction_retrieve-repeater-item-data-when-clicked