PDA

View Full Version : Slider Update when dragging



ludm
28 Jul 2010, 12:38 PM
Hello,

I have put a slider and I want to update a value in a form while I'm dragging the slider.
I've tried with "change", but it's updating after having released the slider
How can I do this ?

raven77m
28 Jul 2010, 2:18 PM
I cant even get my slider to update a form value at all, your lucky!
:-|
But wouldn't you want to use "ondrag" or something like that?
I remember seeing that in the API docs.

ludm
29 Jul 2010, 12:06 AM
Here is an example of a slider with change event to do an action after the thumb has been released :


var sliderV = new Ext.form.Slider({
increment: 1,
minValue: 1,
maxValue: 50,
maxWidth: 600,
listeners: {
change: function() {
var valSlide=sliderV.getValue();
[put action here]
},
}
});


But I don't know how to use ondrag with the slider

evant
29 Jul 2010, 6:42 PM
The slider is going under some refactoring to make it easier to use. Should be in the next update.

raven77m
31 Jul 2010, 7:12 AM
Am I even close?
I'm usually not this dumb, sorry.
:)


var sliderV = new Ext.form.Slider({
increment: 1,
minValue: 0,
maxValue: 100,
listeners: {
change: function() {
myForm.value=sliderV.getValue();
var myForm = document.createElement('FORM');
myForm.method = 'post';
myForm.device = 'LAMPDIM',
myForm.action = "do.php?";
myForm.target = "LRS";
myForm.id = 'myForm';
myForm.submit();
},
}
});

raven77m
31 Jul 2010, 1:16 PM
WOW, I actually got it to work!!
Thanks for the input ludm (http://www.sencha.com/forum/member.php?154873-ludm)!!

evant
1 Aug 2010, 9:02 PM
There will be a new 'drag' event in the next release.