Results 1 to 6 of 6

Thread: Toggle carousel indicator

  1. #1

    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

    Default

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

  4. #3

    Default

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

  5. #4
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,451
    Answers
    3997

    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
    Modus Create, Senior Fullstack Engineer
    ________________
    Modus Create is based on the model of an open source team. We’re a remote, global team of experts in our field. To find out more about the work we do, head over to our website.

    Check out my GitHub:
    https://github.com/mitchellsimoens

  6. #5

    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 Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,451
    Answers
    3997

    Default

    If you add/remove components to the carousel the indicator will stay in sync with that yes.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Fullstack Engineer
    ________________
    Modus Create is based on the model of an open source team. We’re a remote, global team of experts in our field. To find out more about the work we do, head over to our website.

    Check out my GitHub:
    https://github.com/mitchellsimoens

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
  •