1. #1
    Sencha Premium Member
    Join Date
    Nov 2011
    Posts
    10
    Vote Rating
    0
    SSzretter is on a distinguished road

      0  

    Default NavigationBar - how to disable or hide button as user navigates?

    NavigationBar - how to disable or hide button as user navigates?


    I have added a NavigationBar to my Sencha Touch 2 project, and it automatically adds a 'back' button when I push a view in response to a press of a button in that nav bar.

    The problem is, that same button is still visible and the user can click it again, which pushes the same view again. It's just not a good UI experience, and causes some other issues. SO, is there a way either automatically or manually to either hide, disable, or some other best practice to prevent the button from being used if the user is already looking at the view that button is going to push?

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,327
    Vote Rating
    851
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    You can listen to the activeitemchange event on the navigation view to then show/hide or enable/disable the button based on the new item.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Thread Participants: 1