Odd behavior of numeric fields > 999

Odd behavior of numeric fields > 999

divad.thgirbladivad.thgirbla Posts: 36Questions: 14Answers: 1
edited January 2020 in Editor

I found a weird issue when I'd click on a DataTables row to edit that row's data in Editor. If a numeric field had a value > 999, it would show in Editor as blanks. I traced it back to how I defined the numeric field. I wanted it to have 'type:number' as an attribute, so I first tried this:

{label: 'Pay Rate', name: 'Rate', id: 'Rate', type: 'text', attr:{class:'aNumericField2',type:'number',maxlength:13, min:'0', max:'99999999', step:'0.01'} }

That gives me the odd behavior as noted above. Changing the first instance of type from 'text' to 'number' results in a "SCRIPT5022: SCRIPT5022: Error adding field - unknown field type number." message so I was trying the 'type:number' as an attribute.

The only way I get the normal result of the Editor field displaying correctly was if I dropped the 'type:number' and its related attributes from the definition.

{label: 'Pay Rate', name: 'Rate', id: 'Rate', type: 'text', attr:{class:'aNumericField2',maxlength:13} }

Is there a way to define a numeric field other than as 'type:text'?

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,112Questions: 1Answers: 2,583

    It seems to be behaving here with your code. Could you look at that, please, and see if it helps. If it's still not working for you, please can you update my example, or link to your page, so that we can see the problem.

    Cheers,

    Colin

  • divad.thgirbladivad.thgirbla Posts: 36Questions: 14Answers: 1

    I noticed that your code didn't explicitly define the numeric field as 'type:text' before the attributes, so I did the same thing. I removed 'type:text' from my definition. I still got the strange behavior. I added the 'type:text' to your code before the attributes and your example still worked. Weird. At least I know that it is supposed to work. Seems like something else in my code or environment is interfering. I'll have to look further.

  • colincolin Posts: 15,112Questions: 1Answers: 2,583
    Answer ✓

    Odd, can't think what it could be, but shout if you can get an example of the behaviour that we can look at.

    Colin

  • divad.thgirbladivad.thgirbla Posts: 36Questions: 14Answers: 1

    Closing this out since it only affected my system and I found a work around.

This discussion has been closed.