Page 1 of 1

Dynamic show the Selected options of radiogroup to user mapping from database ???

Posted: Thu Oct 23, 2014 5:49 pm
by Yang Mega

I have a radiogroup "ice" with 3 options, How to dynamic mapping the "default selected" from the database base?? the service response field "ice" will feed one of the 3 different value "noice" " fewice" "withice" , I hope can dynamicly show this value by default selected to show to user ?? how can I do ?? With many thanks! Image Image


Dynamic show the Selected options of radiogroup to user mapping from database ???

Posted: Thu Oct 23, 2014 6:26 pm
by Evgene Karachevtsev

Hello Yang,

Please try this way: map 'ice' property to every radio option in radioGroup like this http://take.ms/dsEN7
and for the 1st radio option add the following code: if ( value === 'noice' ) {
return true;
} else {
return false;
}

for the 2nd and the 3rd radio option add the same code, but replace 'noice' with required value;


Dynamic show the Selected options of radiogroup to user mapping from database ???

Posted: Thu Oct 23, 2014 6:58 pm
by Yang Mega

Thanks, Your solutions are always the best and smart!


Dynamic show the Selected options of radiogroup to user mapping from database ???

Posted: Thu Oct 23, 2014 7:07 pm
by Yang Mega

By the way, what the different of these two code ???

======================
var taste = localStorage.getItem('myTaste');
var taste =Apperyio.storage.myTaste.get(); Image Image


Dynamic show the Selected options of radiogroup to user mapping from database ???

Posted: Fri Oct 24, 2014 9:46 am
by Evgene Karachevtsev

Hello,

In the second case you use our API (http://devcenter.appery.io/documentat...), and after calling our get method you do not need to call JSON.parse to get a working array/object with which you can work immediately.


Dynamic show the Selected options of radiogroup to user mapping from database ???

Posted: Mon Mar 30, 2015 7:38 pm
by RobertJay

Just want to confirm that five months later that solution still works. Thanks.