1. #1
    Sencha User
    Join Date
    Nov 2012
    Posts
    8
    Vote Rating
    0
    paltinescu is on a distinguished road

      0  

    Default Answered: Toggle carousel indicator

    Answered: Toggle carousel indicator


    Hi,

    Is there a way to toggle a carousel's indicator at runtime (so, to set its indicator property to true or false, once it's loaded in page)?

    Thanks!

  2. The setter will destroy the old indicator and create a new one which works but is not optimal. You can just hide the one that is created:

    Code:
    carousel.getIndicator().hide();
    carousel.getIndicator().show();

  3. #2
    Sencha User
    Join Date
    Apr 2010
    Location
    China
    Posts
    227
    Vote Rating
    19
    Answers
    64
    haduki will become famous soon enough

      0  

    Default


    Code:
    carousel.setIndicator({hidden:true})//hide the indicator
    carousel.setIndicator({hidden:false})//show the indicator
    I write English by translator.

  4. #3
    Sencha User
    Join Date
    Nov 2012
    Posts
    8
    Vote Rating
    0
    paltinescu is on a distinguished road

      0  

    Default


    Somehow I keep forgetting that configuration options are set using the setConfigName() methods... Thanks!

  5. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,624
    Vote Rating
    434
    Answers
    3105
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    The setter will destroy the old indicator and create a new one which works but is not optimal. You can just hide the one that is created:

    Code:
    carousel.getIndicator().hide();
    carousel.getIndicator().show();
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    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 almost in print!

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

  6. #5
    Sencha User
    Join Date
    Nov 2012
    Posts
    8
    Vote Rating
    0
    paltinescu is on a distinguished road

      0  

    Default


    Quote Originally Posted by mitchellsimoens View Post
    The setter will destroy the old indicator and create a new one which works but is not optimal. You can just hide the one that is created:

    Code:
    carousel.getIndicator().hide();
    carousel.getIndicator().show();
    Great tip! One question, though: could an existing (hidden or not) carousel indicator be updated automatically by adding (or removing) elements from the carousel?

  7. #6
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,624
    Vote Rating
    434
    Answers
    3105
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    If you add/remove components to the carousel the indicator will stay in sync with that yes.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    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 almost in print!

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