使用范围:UI2
Contents
class Util ($UI/system/lib/base/util)
Util工具类
Constructor Top
Util () |
Static Methods Top
void | addCookie (String name, String value, String path, Integer expiresHours) | |
Object | apply (Object object, Object config, Object defaults) | |
function | bindModelFn (ModelBase model, function fn, object caller) | |
callModelFn (Object option) | ||
Object | clone (Object value) | |
Boolean | confirm (String text) | |
void | deleteCookie (String name, String path) | |
void | disableTouchMove (Element e) | |
void | enableTouchMove (Element e) | |
String | getCookie (String name) | |
String | getHost () | |
String | getHref () | |
ModelBase | getModel (Element element) | |
String | getPathname () | |
String | getSearch () | |
void | hint (String text, JSON options) | |
object | iif (boolean condition, object trueValue, object falseValue) | |
Boolean | isArray (Object value) | |
Boolean | isBoolean (Object value) | |
Boolean | isFunction (Object value) | |
Boolean | isObject (Object value) | |
Boolean | isString (Object value) | |
Array |
keys (JSON json) | |
Boolean | testEmail (String value) | |
Boolean | testInteger (String value) | |
Boolean | testLength (String value, Integer min, Integer max) | |
Boolean | testMobile (String value) | |
Boolean | testNumber (String value) | |
Object | toArray (Object iterable, Integer start, Integer end) | |
String | toExprString (String dataType, Object value, Boolean isKSQL) | |
String | toUrl (String url) |
Constructor details
Top
public
Util
()
Util工具类
public
Util
()
Util工具类
Static Methods Detail Top
static
public
void
addCookie
(String name, String value, String path, Integer expiresHours)
添加cookie
static
public
Object
apply
(Object object, Object config, Object defaults)
返回和model关联的function
static
public
callModelFn
(Object option)
执行model下的函数
在html节点上绑定事件调用model的函数doClick,doClick接收参数event var html = "
static
public
Object
clone
(Object value)
对象克隆
static
public
Boolean
confirm
(String text)
询问提示框
static
public
void
deleteCookie
(String name, String path)
删除cookie
static
public
void
disableTouchMove
(Element e)
取消节点上的触摸功能
static
public
void
enableTouchMove
(Element e)
开启节点上的触摸功能
static
public
String
getCookie
(String name)
获取cookie
static
public
String
getHost
()
获取当前完整域名和端口
static
public
String
getHref
()
获取当前完整URL
根据dom node返回相应的Model实例
static
public
String
getPathname
()
获取当前除域名以外的路径
static
public
String
getSearch
()
获取当前除域名?后部分
static
public
void
hint
(String text, JSON options)
消息提醒
static
public
object
iif
(boolean condition, object trueValue, object falseValue)
条件判断
static
public
Boolean
isArray
(Object value)
判断值的类型是否是Array类型
static
public
Boolean
isBoolean
(Object value)
判断值的类型是否是Boolean类型
static
public
Boolean
isFunction
(Object value)
判断是否是函数
static
public
Boolean
isObject
(Object value)
判断值的类型是否是Object类型
static
public
Boolean
isString
(Object value)
判断值的类型是否是String类型
static
public
Array
keys
(JSON json)
获取键组
static
public
Boolean
testEmail
(String value)
检查格式是否为Email
static
public
Boolean
testInteger
(String value)
检查格式是否为整数
static
public
Boolean
testLength
(String value, Integer min, Integer max)
字符长度是否在指定范围
static
public
Boolean
testMobile
(String value)
检查格式是否为手机号码
static
public
Boolean
testNumber
(String value)
检查格式是否为数值
static
public
Object
toArray
(Object iterable, Integer start, Integer end)
转换成数组
static
public
String
toExprString
(String dataType, Object value, Boolean isKSQL)
转换成表达式
static
public
String
toUrl
(String url)
转换$UI开头的url