Chris6743166
Posts: 1
Joined: Tue Mar 18, 2014 11:50 am

Dynamically labelled nav btn changes style. How to stop?

When I dynamically change the text of a navbar button using data from localstorage, the button's styling changes. See button 1 and 2 here:

http://appery.io/app/view/25807b5d-c4...

NOTE: You have to reload the page once to see the buttons populated with localstorage values.

  1. How can I stop the buttons from changing style when the text changes?

  2. How can I ensure that the text is displayed from localstorage on first load?

    The app is shared with Appery Support.

    Thanks in advance for your help!

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

Dynamically labelled nav btn changes style. How to stop?

Hello Chris,

Service that you execute on load event is asynchronous. Thus, when you are using local storage variables immediately they are empty. The service response isn't ready yet. You should use your JS code on 'success' event for the "get_page_slugs_data" service.
To prevent button style changing you should use this code: $('[name=buttonName] .ui-btn-text').text("text");
where buttonName is the name of your button component.

Chris6743166
Posts: 1
Joined: Tue Mar 18, 2014 11:50 am

Dynamically labelled nav btn changes style. How to stop?

Bingo! Your product is awesome and the support equally so. Thanks.

Return to “Issues”