Results 1 to 6 of 6

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

  1. #1
    Sencha User
    Join Date
    Jun 2011
    Posts
    93
    Answers
    3
    Vote Rating
    3
      0  

    Default 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 - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,412
    Answers
    3898
    Vote Rating
    1288
      0  

    Default

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

  4. #3
    Sencha User
    Join Date
    Jun 2011
    Posts
    93
    Answers
    3
    Vote Rating
    3
      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
    Answers
    132
    Vote Rating
    101
      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
    Answers
    3
    Vote Rating
    3
      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
    Answers
    3
    Vote Rating
    3
      0  

    Default

    tomalex has updated his plugin, this issue is resolved.

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
  •