2

I have a JQXGrid which utilizes the jqxNumberInput to allow users to enter number and what not.

createeditor: function (row, cellvalue, editor) {
     editor.jqxNumberInput({ spinMode: "simple", decimalSeparator: decimalSeparator, groupSeparator: groupSeparator });
},

declared like so.

My problem is, when the input has a negative number in the fields i.e. "-110.50" the behavior gets tricky. If the user selects the entire input and hits delete the new value is "-0.00". If they then try to type "50.50" into the input the negative removes making the number "-50.50".

You can highlight and delete whatever you want but the only way to get rid of that negative is to put the number to "-0.00" and use the spinner to iterate the value up word, which is terrible for UX.

I did the google search thing and I couldn't find anything in the api or other SO questions related to this problem.

If anyone has hit this problem and has a solution it would be greatly appreciated.

QBM5
  • 2,778
  • 2
  • 17
  • 24

2 Answers2

1

You could just watch for keyup event. If they hit delete set the value to 0 and the minus sign will be removed.

 $("#jqxNumberInput").jqxNumberInput({

 }).keyup(function(evn){
     if(evn.keyCode === 46){
         //they hit delete so set the value to 0
         $('#jqxNumberInput').jqxNumberInput('setDecimal', 0);
     }
 });
Molda
  • 5,619
  • 2
  • 23
  • 39
0

To get rid of the negative number you can hit "-" to toggle the negative symbol.

scripto
  • 2,297
  • 1
  • 14
  • 13
  • That is a terrible UX design, after having ten people look into the issue only one person thought of doing that, and it was something he though might work after trying ten other things first. Thanks for the input though – QBM5 Mar 25 '15 at 13:36
  • well, probably you'll have to teach your users or use a different widget – scripto Mar 25 '15 at 17:42