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

Is there an easy way to disable the spinners?

18 Answers 1557 Views
NumericTextBox
This is a migrated thread and some comments may be shown as answers.
Ian
Top achievements
Rank 1
Ian asked on 21 Dec 2011, 08:50 PM
The spinners may not always be desired on all of the numeric textboxes. Is there an easy way to disable them? If not, could you guys consider adding that feature? Thanks!

18 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 22 Dec 2011, 11:02 AM
Hello,

 
Currently there is no build-in way to disable the spinners. Nevertheless you can easily achieve this with JavaScript - check this jsFiddle demo. I have logged your request to our internal system. If more users wants such functionality we will schedule it for further investigation.

Kind regards,
Georgi Krustev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Olle
Top achievements
Rank 1
answered on 05 Jan 2012, 11:41 PM
+1 for an easy way to disable the spinners.
0
Georgi Krustev
Telerik team
answered on 06 Jan 2012, 09:17 AM
Hello,

 
You can share your feedback in the user voice page. Thus the users will be able to vote for this functionality.

All the best,
Georgi Krustev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Ian
Top achievements
Rank 1
answered on 06 Jan 2012, 02:51 PM
Created an issue here. Thanks for the help Georgi!

Upvote this issue here!
0
Nathan
Top achievements
Rank 1
answered on 29 Feb 2012, 03:09 PM
The posted example does not actually disable the spinners. It just removes the images from the numeric text box. When the text box has focus, the Up/Down arrow still causes the spinning (i.e. increment and decrement) to happen. 
0
Oscar
Top achievements
Rank 1
answered on 21 Mar 2012, 01:07 PM
Is this functionality implemented in Q1 2012?
Regards.
0
Georgi Krustev
Telerik team
answered on 22 Mar 2012, 10:56 AM
Hello,

 
This functionality is still under consideration. There are features and fixes with higher priority and we need to take case of them first.

All the best,
Georgi Krustev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Oscar
Top achievements
Rank 1
answered on 22 Mar 2012, 11:12 AM
Hi Georgi,
The problem with this is that users use to press down/up arrow to navigate from cell to cell. When a numericTextBox is the editor of a cell in a grid, this causes to increment/decrement its value, instead of going to the cell above/below.
0
Georgi Krustev
Telerik team
answered on 27 Mar 2012, 08:11 AM
Hello Oscar,

 
In this case you will need to unbind the "keydown" event of the input element. Check the updated jsFiddle demo.

All the best,
Georgi Krustev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Oscar
Top achievements
Rank 1
answered on 27 Mar 2012, 09:53 AM
Hello Georgi,
Thank you for the jsFiddle demo.
If I unbind the keydown event, our decimal separator (comma) is shown as a dot when the user enters a decimal number using the numeric keyboard. (our kendo.culture is not 'en-US'). Is there any other workaround for this?
Regards,
Oscar.
0
Georgi Krustev
Telerik team
answered on 28 Mar 2012, 10:09 AM
Hello Oscar,

 
You will need to unbind the keydown event handler only if you need the input to be readonly. Could you please elaborate more on how you need to use the NumericTextBox? When it should be readonly and when it should not?

All the best,
Georgi Krustev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Euro
Top achievements
Rank 1
answered on 01 Aug 2012, 09:49 PM
A better workaround to disable the spinners (until the feature is implemented), is to set the step property to 0:

$("#initial").kendoNumericTextBox({
    step:0
});

It's not perfect because Up and Down still cause the caret to move, but at least it won't modify the value in the box.
0
Joshua
Top achievements
Rank 1
answered on 19 Aug 2013, 07:13 PM
I noticed the numerictextbox has a spinners option now but I cannot seem to use the data-attributes such as data-spinners="false".

I think this is a bug and never added in since all the other options seem to work this way.


Any help here? Thanks!
0
Georgi Krustev
Telerik team
answered on 20 Aug 2013, 07:59 AM
Hello Joshua,

I believe that the spinners option works just fine. Check this jsBin demo

Regards,
Georgi Krustev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Koen
Top achievements
Rank 1
answered on 08 Mar 2016, 04:48 PM
Is this option already available now to easily disable them?
0
Konstantin Dikov
Telerik team
answered on 09 Mar 2016, 02:35 PM
Hi Koen,

As mentioned in one of the previous posts, there is a spinners property that will determine whether or not to render the spinners:
As you will notice, setting "spinners" to "false" will prevent the rendering of the spinners.


Best Regards,
Konstantin Dikov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Ryan
Top achievements
Rank 1
answered on 17 Jul 2018, 05:05 PM

That solution doesn't actually accomplish what the poster wanted: To stop the up/down arrow keys from changing the value in the numeric text box.  It removes the up/down arrows but this is just cosmetic.

An earlier suggestion of unbinding the keydown event also winds up removing the ability to hit ENTER to complete the editing.

I liked another suggestion of using jQuery to set the step to 0.  This seemed to work well in a jsFiddle.  However in my implementation I can't get it to work.  I put the "data-step=0" in various elements but the arrow keys still increment/decrement the numeric value.  As you may notice I also tried removing the "role" attribute that said "role=spinnerbutton"

This numeric textbox is just the standard Kendo construction when I've marked my grid as "editable" i.e. I'm allowing in-cell editing here.  There is no custom template.  I tried to implement one but I'm not an expert on that and couldn't get it to work.

Attached is a screenshot of my markup.  Any advice on the best approach here?

0
Konstantin Dikov
Telerik team
answered on 20 Jul 2018, 11:52 AM
Hello Ryan,

In the context of the Grid you could handle the "edit" event and change the configuration of all NumericTextBox editors with the following code:
edit: function(e){
  var numeric = e.container.find("[data-role='numerictextbox']");
  if(numeric.length > 0){
     numeric.data("kendoNumericTextBox").setOptions({
       spinners: false,
       step: 0 
     })
  }                         
},

Hope this helps.


Regards,
Konstantin Dikov
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
NumericTextBox
Asked by
Ian
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Olle
Top achievements
Rank 1
Ian
Top achievements
Rank 1
Nathan
Top achievements
Rank 1
Oscar
Top achievements
Rank 1
Euro
Top achievements
Rank 1
Joshua
Top achievements
Rank 1
Koen
Top achievements
Rank 1
Konstantin Dikov
Telerik team
Ryan
Top achievements
Rank 1
Share this question
or