slider drag handle responds slow

3 posts, 0 answers
  1. MBEN
    MBEN avatar
    214 posts
    Member since:
    Nov 2011

    Posted 23 Jun Link to this post

    I have a slider with divs that get updated on clientside with the slider value.

    I noticed that my slidervalue changes first and there's a little lag when the draghandle responds. Below is my slider definition and my client side code. Could you help me figure the delay in the drag handle response?

    <telerik:RadSlider  ID="RadSliderAge" runat="server"  MinimumValue="0" MaximumValue="90"
    IsSelectionRangeEnabled="true" SelectionStart="45" SelectionEnd="70"  SmallChange="1"
    OnClientSlide="clientValueAgeChange" OnClientLoad="clientValueAgeLoad" ShowDecreaseHandle="true"     ShowIncreaseHandle="true"  TrackMouseWheel="false"
        ThumbsInteractionMode="Lock" Skin="Material"
    >
    </telerik:RadSlider>
    function clientValueAgeLoad(sender, eventArgs) {
        var CurrentAgeCtrl = document.getElementById("CurrentAgeCtrl");
        var RetirementAgeCtrl = document.getElementById("RetirementAgeCtrl");
        CurrentAgeCtrl.innerHTML = sender.get_selectionStart();
        RetirementAgeCtrl.innerHTML = sender.get_selectionEnd();
    }

    function clientValueAgeChange(sender, eventArgs) {
        var CurrentAgeCtrl = document.getElementById("CurrentAgeCtrl");
        var RetirementAgeCtrl = document.getElementById("RetirementAgeCtrl");
        CurrentAgeCtrl.innerHTML = sender.get_selectionStart();
        RetirementAgeCtrl.innerHTML = sender.get_selectionEnd();
        CalcOutputs();
    }

     

  2. MBEN
    MBEN avatar
    214 posts
    Member since:
    Nov 2011

    Posted 25 Jun in reply to MBEN Link to this post

    Hi Admins, Any ideas why my drag handle is responding slower than the slider value change?
  3. Doncho
    Admin
    Doncho avatar
    42 posts

    Posted 26 Jun Link to this post

    Hi,

    I am afraid we are not aware of such a problem.

    I have tested the provided code and on my side, it is working smoothly, see http://somup.com/cY1OotQziz

    A possible reason for the experienced behavior could be if complicated logic is executed in the CalcOutputs() method.

    I would suggest taking the CalcOutputs() method out of the OnClientSlide event listener. Instead, you can call it in the OnClientSlideEnd event

    OnClientSlide="clientValueAgeChange" OnClientSlideEnd="clientSlideEnd"

    I hope this will help!

    Kind regards,
    Doncho
    Progress Telerik

    Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
    Our thoughts here at Progress are with those affected by the outbreak.
Back to Top