Results 1 to 6 of 6

Thread: Toggle carousel indicator

  1. #1
    Sencha User
    Join Date
    Nov 2012
    Posts
    8
    Vote Rating
    0
      0  

    Default 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
    Answers
    64
    Vote Rating
    20
      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
      0  

    Default

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

  5. #4
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,323
    Answers
    3884
    Vote Rating
    1294
      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 @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    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.

  6. #5
    Sencha User
    Join Date
    Nov 2012
    Posts
    8
    Vote Rating
    0
      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 - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,323
    Answers
    3884
    Vote Rating
    1294
      0  

    Default

    If you add/remove components to the carousel the indicator will stay in sync with that yes.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    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.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •