关于ExtJS对javascript中的Number的扩展,能够參考其帮助文档,文档下载地址:http://download.csdn.net/detail/z1137730824/7748893
以下对当中的部分方法进行介绍:
(1)constrain
检查给定的数值是否在约束的范围内。 If the number is already within the 假设再范围内就返回此数值。否则,假设大于最大值则返回最大值,假设小于最小值则返回最小值。, otherwise the min or max value is returned depending on which side of the range is 注意本方法不改变给定的数值本身。 Note that this method returns the constrained value but does not change the current number.
Parameters
Returns
- Number
The constrained value if outside the range, otherwise the current value