1. #1
    Sencha User
    Join Date
    Jun 2011
    Posts
    93
    Vote Rating
    3
    Answers
    3
    eyepoker is on a distinguished road

      0  

    Default Answered: SliderFill not updating when using slider.setValue()

    Answered: SliderFill not updating when using slider.setValue()


    I have the SliderFill installed and working, however, if I update the slider via slider.setValue() SliderFill does not update - anyone know how to modify sliderFill to update in this scenario?

    Thanks,
    Rick

  2. tomalex has updated his plugin, this issue is resolved.

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,647
    Vote Rating
    898
    Answers
    3575
    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


    What are you passing to the setValue?
    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.

  4. #3
    Sencha User
    Join Date
    Jun 2011
    Posts
    93
    Vote Rating
    3
    Answers
    3
    eyepoker is on a distinguished road

      0  

    Default


    I'm sending it a number when a text field is updated.

    So, a change event fires on the txt field when I modify the number (str) it contains, I then update the slider by grabbing the textfield value, parseInt to a number and then i do a setValue() on the slider.

    I have an example at the link below:

    http://rickluna.com/examples/SliderFillExample.zip

  5. #4
    Sencha User jerome76's Avatar
    Join Date
    Apr 2012
    Location
    New Jersey
    Posts
    1,149
    Vote Rating
    99
    Answers
    132
    jerome76 is just really nice jerome76 is just really nice jerome76 is just really nice jerome76 is just really nice jerome76 is just really nice

      0  

    Default


    The 'change' event never gets fired when you use the setValue function of the sliderfill. If you can get it to fire that event, then it should be fixed.

    Code:
    //only gets called when you drag it, but not when the setValue is called.
    cmp.on('change',function(slider,sl,thumb){
        var thumbarr_val = slider.getComponent().getThumbs();
        Ext.defer(function(){
            me.thumbAdjust(slider,thumb,thumbarr_val.indexOf(thumb));
         },200);
    });
    I also saw a bunch of console.logs in that code, did you put those in there to debugging purposes? Just make sure to clean those up afterwards.

  6. #5
    Sencha User
    Join Date
    Jun 2011
    Posts
    93
    Vote Rating
    3
    Answers
    3
    eyepoker is on a distinguished road

      0  

    Default


    ah..., i thought that maybe the change event wasnt firing, and tried to do so manually but without luck.

    It appears then that setValue() *should* be firing the change event, is that correct Mitchell?

    The logs come in the plugin that way - thanks for the reminder to remove them.

  7. #6
    Sencha User
    Join Date
    Jun 2011
    Posts
    93
    Vote Rating
    3
    Answers
    3
    eyepoker is on a distinguished road

      0  

    Default


    tomalex has updated his plugin, this issue is resolved.

Thread Participants: 2

Tags for this Thread