Yang Mega
Posts: 0
Joined: Sun Aug 31, 2014 6:08 am

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

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

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

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

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;

Yang Mega
Posts: 0
Joined: Sun Aug 31, 2014 6:08 am

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

Thanks, Your solutions are always the best and smart!

Yang Mega
Posts: 0
Joined: Sun Aug 31, 2014 6:08 am

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

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

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

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

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

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.

RobertJay
Posts: 0
Joined: Fri Jun 15, 2012 1:32 pm

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

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

Return to “Issues”