Author Topic: Badness of the validations options  (Read 2483 times)

eloan

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 25
    • View Profile
Badness of the validations options
« on: December 26, 2016, 09:07:53 am »
Hi.

Please help me.
The validations option does behavior in assumption outside.

I want to validate in 0 to 100.
But when a number of 2-9 is included, it'll be a validation error.

----- test code ---------------------------
   <div id="sample" style="margin:auto;"></div>
<script>
$(function() {
   var col = [{"title":"sample","dataType":"number","dataIndx":"indata","editable":true
                  ,"validations":[   {"type":"gte","value":0      ,"msg":"0 grater or equal"}
                        ,   {"type":"lte","value":100   ,"msg":"100 less or equal"}]
         }];
   var data = { data:[{}]};
    $("#sample").pqGrid({ colModel: col, dataModel: data});
});
</script>
---------------------------------------------

input data is
    -1 : 0 grater or equal
     0 : ok
     1 : ok
     2 : 100 less or equal              <- why?
   99 : 100 less or equal              <-  why?
 100 : ok
 101 : 100 less or equal
 
Best regards.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6312
    • View Profile
Re: Badness of the validations options
« Reply #1 on: December 26, 2016, 10:12:11 am »
For numbers, dataType can be either "integer" or "float".

http://paramquery.com/pro/api#option-column-dataType

eloan

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: Badness of the validations options
« Reply #2 on: December 26, 2016, 12:04:37 pm »
Thank you!!
It was settled.

I have next question.
Can't use cursor key when type is integer?

Best Regards.

eloan

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: Badness of the validations options
« Reply #3 on: December 26, 2016, 12:13:12 pm »
sorry.

It was a misunderstanding.
A Cursor key was effective.

All problems were settled.