Rafael Martínez
Posts: 0
Joined: Tue Apr 23, 2013 5:19 pm

'value change' event for the toggle inside a dynamic list

Inside this there is another real issue because the val() function for the toggle returns always the same value when the toggle is inside the list.

Find it here:

http://appery.io/app/view/42ec9b46-87...

It is necessary to manually change the val of the toggle in the "value change" event for the toggle in this way:

if (Appery('mobiletoggle_21').val() == "off"){
Appery('mobiletoggle_21').val("on").refresh();
} else {
Appery('mobiletoggle_21').val("off").refresh();
}

Oleg Danchenkov
Posts: 0
Joined: Tue Apr 30, 2013 5:51 pm

'value change' event for the toggle inside a dynamic list

Hi Rafael.
Appery('mobiletoggle_21') refers to hidden element used for mapping.
On Value change event you should use $(this) instead of Appery('mobiletoggle_21').
Change
alert(Appery('mobiletoggle_21').val());
to
alert($(this).val());

Rafael Martínez
Posts: 0
Joined: Tue Apr 23, 2013 5:19 pm

'value change' event for the toggle inside a dynamic list

This works!, thank you so much.

Rafael Martínez
Posts: 0
Joined: Tue Apr 23, 2013 5:19 pm

'value change' event for the toggle inside a dynamic list

\n {\n \""name\"": \""two\""\n }

Return to “Issues”