This is a migrated thread and some comments may be shown as answers.

slider drag handle responds slow

2 Answers 94 Views
Slider
This is a migrated thread and some comments may be shown as answers.
MBEN
Top achievements
Rank 2
Veteran
MBEN asked on 23 Jun 2020, 11:02 PM

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 Answers, 1 is accepted

Sort by
0
MBEN
Top achievements
Rank 2
Veteran
answered on 25 Jun 2020, 09:48 PM
Hi Admins, Any ideas why my drag handle is responding slower than the slider value change?
0
Doncho
Telerik team
answered on 26 Jun 2020, 04:37 PM

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.
Tags
Slider
Asked by
MBEN
Top achievements
Rank 2
Veteran
Answers by
MBEN
Top achievements
Rank 2
Veteran
Doncho
Telerik team
Share this question
or