Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

How to determine the state of a toggle switch?

Hi John,

This is a bug.
As a workaround add the following JavaScript code on Page Show event:

codeAppery( "mobiletoggle_23" ).val( localStorage.getItem( "toggle_state" ) ).slider( "refresh" );/codewhere localStorage.getItem( "toggle_state" ) stores "on" or "off".

John Herdean
Posts: 0
Joined: Tue May 14, 2013 3:56 am

How to determine the state of a toggle switch?

ok good that worked. Let me know when the standard way works again

John Herdean
Posts: 0
Joined: Tue May 14, 2013 3:56 am

How to determine the state of a toggle switch?

Hello, Im running into the same problems with the SelectMenus (the single selection - for this im looking just to have the item selected according to the localstorage value), and radio buttons. Please let me know how to set these two types as well? Thanks

John Herdean
Posts: 0
Joined: Tue May 14, 2013 3:56 am

How to determine the state of a toggle switch?

also, is there any documentation or tutorials on all the different types of components how to set them by JS?

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

How to determine the state of a toggle switch?

jquerymobile.com is your source for this.

John Herdean
Posts: 0
Joined: Tue May 14, 2013 3:56 am

How to determine the state of a toggle switch?

i tried looking at their site and its so confusing. They have a long list of Articles & Tutorials (which im guessing is the closest to what im looking for) and nothing is organized. I cant find anything from there. Ill probably spend all nite on their site and still be stuck - thats how confusing it is.

For the selectmenu im guessing its:

Appery( "selectmenu_name" ).val( localStorage.getItem( "select_value" ) ).selectmenu ( "refresh" );

and for the radiobutton im guessing its:

Appery( "radiobutton_name" ).val( localStorage.getItem( "radio_value" ) ).radiobutton ( "refresh" );

Are those right? thanks

John Herdean
Posts: 0
Joined: Tue May 14, 2013 3:56 am

How to determine the state of a toggle switch?

and i would try to test them but the testing site is down again for past hour almost. its not updating the changes. It seems the testing site is up and down all day long

John Herdean
Posts: 0
Joined: Tue May 14, 2013 3:56 am

How to determine the state of a toggle switch?

well, the testing is back i guess. It doesnt look like the my radiobutton line worked i get this error from firebug:

TypeError: Appery(...).val(...).radiobutton is not a function

And something is strange for the textinput because it has no issues like this:

Appery('current_password').val('').textinput('refresh');

but, when i write it like this:

Appery('llm3_first_name').val(localStorage.getItem('first_name')).textinput('refresh');

it throws this error:

Error: no such method 'refresh' for textinput widget instance

Please help with this 2 issues. Thanks.

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

How to determine the state of a toggle switch?

Did you test it?
codeAppery('llm3_first_name').val(localStorage.getItem('first_name')).textinput('refresh'); /code works as expected.

John Herdean
Posts: 0
Joined: Tue May 14, 2013 3:56 am

How to determine the state of a toggle switch?

yes firebug gives me this error:

Error: no such method 'refresh' for textinput widget instance

Return to “Issues”