1

Disable in slider component?

asked 2009-06-17 01:11:37 +0800

hologrinder gravatar image hologrinder
16 1

Is there a way to disable sliders, like setDisable() in Button and other components?

delete flag offensive retag edit

7 Replies

Sort by ยป oldest newest

answered 2009-06-17 09:37:49 +0800

kindalu gravatar image kindalu
255

This component didn't provide that method.
there are several work around,
1.put a transparent div over it. (better put the gray opacity=.5 :D)
2.listen to drag event, set the value back to 0 when drag event happen
3.write javascirpt to disable the slider's action
BTW, most of input box support setDisable()

link publish delete flag offensive edit

answered 2009-06-17 23:05:12 +0800

hologrinder gravatar image hologrinder
16 1

Thank you for your reply, that was useful.

link publish delete flag offensive edit

answered 2012-09-08 01:28:25 +0800

happycampo gravatar image happycampo
63

hologrinder,

do you have a working solution for this? I'm currently struggling with disabling my sliders.

thanks,
Chris

link publish delete flag offensive edit

answered 2012-10-02 02:07:28 +0800

samchuang gravatar image samchuang
4084 4

hi, you can also post zk feature request

link publish delete flag offensive edit

answered 2013-07-01 17:07:13 +0800

Neus gravatar image Neus
1415 14

Hi, I want to do it too. How can I do any of these actions???:

1.put a transparent div over it. (better put the gray opacity=.5 :D) or 3.write javascirpt to disable the slider's action

Thank you!

link publish delete flag offensive edit

answered 2014-01-08 13:14:11 +0800

betosantin gravatar image betosantin
1

I disable slider action with override method makeDraggable() and method doClic() native from zk

with function override _makeDraggable:

function() {" "this.drag = new zk.Draggable(this, this.$n(\"btn\"), {" "constraint: this.orient || \"horizontal\"," "starteffect: this.startDrag," "change: this.dragging,"+ "endeffect: this.endDrag"+ "});"+ "zk.Draggable.prototype.updateDrag = function(){}" "}

and override function doClic_():

function(){}

It is my solution from this problem.

link publish delete flag offensive edit

answered 2014-01-08 14:36:31 +0800

chillworld gravatar image chillworld flag of Belgium
5367 4 9
https://github.com/chillw...

updated 2014-01-08 14:37:09 +0800

I don't get it. Why didn't they resolved this in zk 7.0.0 API?

They didn't extend the slider to inputElement (where the disabled is implemented) but it's still an input element!

And yet there are more parts except disable very intresting to implement. Take now the constraints.

I want to have a slider from 1 to 1000 but there is a range what you may not choose. Example 200 to 300 is forbidden.

TabIndex very handy if you can get there when your mouse is broken, and then shift with your arrow keys.

readOnly => maybe some roles may not slide this thing.

....

So I propose to let the slider extend to InputElement .

Greetz chill.

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2009-06-17 01:11:37 +0800

Seen: 272 times

Last updated: Jan 08 '14

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More