`

CDG5: zkCDG5:zk

    博客分类:
  • zk
 
阅读更多

 

CDG5: zkCDG5:zk

From Documentation从文档

Jump to:跳转到:navigation导航,search搜索
<!-- start content -->

Language Enhancement Utilities语言增强工具

Contents内容

[hide]
<script type="text/javascript"></script>

Public Static Data公共静态数据

DECIMAL十进制

char DECIMAL;

The character used for decimal sign.字符用于十进制签署。

GROUPING分组

char GROUPING;

The character used for thousands separator.字符用于成千上万的分隔符。

MINUS减去

char MINUS;

The character used to represent minus sign.字符用于表示负号。

PER_MILLPER_MILL

char PER_MILL

The character used for mille percent sign.字符用于bim百分号。

PERCENT百分比

char PERCENT;

The character used for percent sign..字符用于百分号. .

bootstrapping引导

boolean bootstrapping;

Indicates whether ZK Client Engine is just initialized and creating the initial widgets. ZK客户指示是否引擎只是���始化并创建初始窗口小部件。In other words, it is not caused by asynchronous update.换句话说,它并不是引起异步更新。

  • See Also看到也
    • #moutning# moutning- zk.- zk。bootstrapping implies zk.zk bootstrapping的暗示。mounting but not vice verse (the other case for zk.越来越多的但不是恶习(其他理由。zkmounting is asynchronous update)安装是异步更新)

build构建

String build;

The build of ZK, such as '08113021'ZK的构建,比如‘08113021’

confirmCloseconfirmClose

String confirmClose;

The message to show up before closing the browser window or navigating to other URL.消息出现之前关闭浏览器窗口或者导航到其他URL。

  • Default: null默认值是null
  • Alternatively, you can add a function to be called by use of此外,您可以添加一个函数的调用使用#beforeUnload# beforeUnload.

currentFocuscurrentFocus

zk.Widgetzk.WidgetcurrentFocus;currentFocus;

The widget that gains the focus now, or null if no one gains focus now.这个小部件获得现在的焦点,或null如果没有人获得焦点现在。

currentPointercurrentPointer

Offset currentPointer;

The current mouse pointer.当前的鼠标指针。

currentModalcurrentModal

zul.wnd.Window currentModal;

The topmost modal widow, or null if no modal window at all.最上层的模态的寡妇,或null如果没有模式窗口在所有。

keyCapturekeyCapture

zk.Widget keyCapture;

Used to specify a widget that shall receive the following the onKeyPress and onKeyUp events, no matter what widget the event occurs on.一个小部件,用于指定要受onKeyPress onKeyUp事件后,,不管什么小部件上的事件发生。

1
2
3
4
doKeyDown_: function () {
zk.keyCapture = this;
this.$supers('doKeyDown_', arguments);
}

Notice that the key capture is reset automatically after processing onKeyUp_.注意,关键是复位后自动捕获onKeyUp_处理。

lastPointerlastPointer

Offset lastPointer;

The last position that the mouse was clicked (including left and right clicks).最后的立场是,鼠标点击了(包括左和右点击)。

loading加载

int loading;

The number of widget packages (i.e., JavaScript files) being loaded (and not yet complete). 小部件包的数量(即JavaScript文件)加载(和未完成)。When the JavaScript files of widgets are loading, you shall not create any widget. 当小部件的JavaScript文件装载,你不能创造任何部件。Rather, you can use相反,您可以使用zPkg#afterLoadzPkg #增加to execute the creation and other tasks after all required JavaScript files are loaded.执行创建和其他任务所需的所有JavaScript文件后被加载。

mounting安装

boolean mounting;

Whether ZK Client Engine has been mounting the peer widgets. ZK客户引擎是否已经安装对等小部件。By mounting we mean the creation of the peer widgets under the control of the server. 通过挂载我们指的是创建小部件的对等服务器的控制下。To run after the mounting of the peer widgets, use��行安装后的对等的小部件,使用#afterMount# afterMount

mouseCapturemouseCapture

zk.Widget mouseCapture;

Used to specify a widget that shall receive the following the onMouseMove and onMouseUp events, no matter what widget the event occurs on.用于指定一个小部件,必得onMouseMove和onMouseUp事件后,不管什么小部件上的事件发生。

1
2
3
4
doMouseDown_: function () {
zk.mouseCapture = this;
this.$supers('doMouseDown_', arguments);
}

Notice that the mouse capture is reset automatically after processing onMouseUp_.注意,鼠标捕获焦点是处理后onMouseUp_自动重启。

procDelayprocDelay

int procDelay;

The delay before showing the processing prompt (unit: milliseconds).之前的延迟显示处理提示(单位:毫秒)。

  • Default: 900 (depending on the server's configuration)默认值:900(取决于服务器的配置)

processing处理

boolean processing;

Whether Client Engine is processing something, such as processing an AU response. 客户机引擎是否正在处理的东西,例如处理一个非洲联盟的响应。This flag is set when这个标志时设置#startProcessing# startProcessingis called, and cleaned when被称为呢,什么时候#endProcessing# endProcessingis called.被称为。

resendDelayresendDelay

int tipDelay;

The delay before resending the AU request, i.e., assuming the last AU request fails (unit: milliseconds). 非盟的拖延之后,重新发送请求,即假设过去盟请求失败(单位:毫秒)。A negative value means not to resend at all.一个负值意味着不重发在所有。

  • Default: -1 (depending on the server's configuration).默认值:1(取决于服务器的配置)。

 

tipDelaytipDelay

int tipDelay;

The delay before showing a tooltip (unit: milliseconds).显示一个工具提示之前的延迟(单位:毫秒)。

  • Default: 800 (depending on the server's configuration)默认值:800(取决于服务器的配置)

unloading卸载

boolean unloading;

Indicates whether the browser is unloading this document. 指示是否浏览器是卸载这个文档。Note: when注意:当#beforeUnload# beforeUnloadis called, this flag is not set yet.被调用时,这个标志不是集合吗。

version版本

String version;

The version of ZK, such as '5.0.0'ZK的版本,如“5.0.0”

Public Static Method公共静态方法

$default违约美元

Map $default(Map opts, Map defaultOpts);

Provides the default values for the specified options.提供默认值为指定的选项。

  • Example:例子:
1
2
3
process: function (opts, defaultOptions) {
opts = zk.$default(opts, defaultOptions);
}
1
2
3
opts = zk.$default(opts, {timeout: 100, max: true});
//timeout and max are assigned to opts only if no such property found in opts
  • Parameters参数
    • opts- the options to be added the default options.——该选项来添加默认选项。
    • defaultOptions- the default options——默认的选项
  • Returns the options after applying the default options, or null if both opts and defaultOpts are null.返回选项申请后,默认的选项,或null如果双方选择和defaultOpts是null。

$extends$扩展

zk.Class $extends(zk.Class superclass, members, staticMembers);
zk.Class $extends(String superclassName, members, staticMembers);

Defines a class. 定义了一个类。It returns the class being defined.它返回的类定义。

  • Example:例子:
1
2
3
4
5
6
7
8
9
zul.Label = zk.$extends(zk.Widget, {
_value: '',
getValue() {
return this._value;
},
setValue(value) {
this._value = value;
}
});

The second format is used to declare a class that depends a class that might not be loaded yet. 第二个格式是用来定义一个类,取决于类,可能不被载入然而。It will cause the superclass to be loaded. 这将导���超类装入。However, you cannot access it until the superclass has been loaded.然而,您不能访问,直到超类已经被加载。

1
2
3
4
5
6
7
8
9
10
11
12
foo.Mine = zk.$extends('zul.inp.Textbox', {
});
new foo.Mine(); //wrong! since zul.inp.Textbox might not be loaded yet
afterLoad(function () { new foo.Mine();}); //correct!
if (foo.Mine.superclass) { //test if it has been defined correctly (true if zul.inp.Textbox is loaded)
}
if (zk.$import('zul.inp')) { //another way to know
}
if (zk.isLoaded('zul.inp')) { //another way to know
}

Special Properties特殊属性

Here is a list of special properties that you can use in the members argument.以下列出的是特殊的属性,您可以使用在成员参数。

Name名称Description描述
$define$定义 Used to specified a map of getters and setters. 用于指定一个getter和setter的地图。It is shortcut to invoke它是快捷键来调用define定义. For example,例如,
1
2
3
4
5
6
7
8
9
10
11
foo.Widget = zk.$extends(zk.Widget, {
_value: '',
$define: {
name: null,
value: null
},
bind_: function () {
//
}
});

is equivalent to相当于

1
2
3
4
5
6
7
8
9
10
foo.Widget = zk.$extends(zk.Widget, {
_value: '',
bind_: function () {
//
}
});
zk.define(foo.Widget, {
name: null,
value: null
});

is equivalent to相当于

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
foo.Widget = zk.$extends(zk.Widget, {
_value: '',
getName: function () {
return this._name;
},
setName: function (v) {
this._name = v;
return this;
},
getValue: function () {
return this._value;
},
setValue: function (v) {
this._value = v;
return this;
},
bind_: function () {
//
}
});
  • Parameters参数
    • superclass- the super class.——超类。
    • members- the non-static members——非静态成员
    • staticMembers- the static members. ——静态成员。Omitted if no static methods.省略了如果没有静态方法。
  • Returns the class返回类

$import进口美元

Object $import(String name, Function fn);

Imports a package or a class. 导入一个包或者一个类。It returns null if the package or class is not defined yet.它返回null如果包或类还没有定义。

  • Example:例子:
1
2
3
4
var foo = zk.$import('com.foo');
var cool = new foo.Cool();
var Cool = zk.$import('com.foo.Cooler');
var cooler = new Cooler();

If you specify an additional function, then it assumes name is a class and it will load the package of the class first, if not found. 如果您指定一个附加的函数,然后它假定的名字是一个类,它将会被加载的类的包第一,如果没有找到。Then, invoke the function after the class is loaded. 然后,调用函数的类被加载后。For example, the following creates a Listbox widget after loading the package.例如,下面创建一个Listbox窗口小部件装船后包。

1
zk.$import('zul.sel.Listbox', function (cls) {new cls();});
  • Parameters参数
    • name- The name of the package or the class.——软件包的名称或类。
    • fn- The function to call after the class is loaded. ——要调用的函数的类被加载后。If specified, it assumes name is a class, and it will load the package of the class automatically.如果指定,它假定的名字是一个类,它将会被加载的类的包自动。
  • Returns the package, or null if not defined返回包,或null如果没有定义

$package包美元

Object $package(String pkgnm);

Defines a package. 定义了一个包。It creates the package if not defined yet. 它创建包,如果还没有定义。It is similar to Java's package statement except it returns the package object.它类似于Java包的声明除了它返回包对象。

  • Example:例子:
1
2
var foo = zk.$package('com.foo');
foo.Cool = zk.#$extends(zk.Object);
  • Parameters参数
    • pkgnm- The name of the package.——软件包的名称。

$void空美元

Object $void();

A does-nothing function, which is useful if you want to assume a does-nothing function, particular with一个does-nothing函数,它是有益的,如果你要承担一个does-nothing功能,尤其是与zEffectzEffect.

 

afterLoad增加

boolean afterLoad(Function func);

boolean afterLoad(String pkgnms, Function func);

The first format decalres a function that shall be executed after all requested packages are loaded (i.e.,第一种格式decalres一个函数,它将会被执行所有需要的包是加载后(即,#loading#加载is 0). If loading has been done, the function is executed immediately.是0)。如果加载已经完成,功能立即执行。

The second format declares a function that shall be executed only if the specified package(s) are loaded (and第二个格式声明一个函数,它应当只执行指定的包(s)装载(和#loading#加载is 0). Notice that it won't cause the package(s) to execute. 是0)。注意:这不会造���包(s)来执行。Rather, it defers the execution of the specified function until someone else loads the package (by use of相反,它无法执行指定的函数,直到别人加载包(通过使用#load#负载). )。It is useful if you want to这是有益的,如果你想customize JavaScript codes定制JavaScript代码.

To know whether all requested packages are loaded (i.e., ZK is not loading any package), you can check知道所有请求的包被加载(即ZK不是加载任何包),您可以检查#loading#加载if it is 0.如果它是0。

Notice that functions specified in the second format execute before those specified in the first format.注意,函数中指定的第二格式之前执行中所规定的第一种格式。

Example示例

1
2
3
zk.afterLoad('foo', function() {new foo.Foo();});
zk.afterLoad('foo1,foo2', function() {new foo1.Foo(foo2.Foo);});
zk.afterLoad(function() {});
  • Return whether the function has been executed. 返回是否已执行的函数。In other words, true is returned if it is executed immediately.换句话说,实在是返回它立即执行。
  • Parameters参数
    • pkgnms - the package(s) that the specified function depends on. pkgnms -包(s),指定的函数依赖。In other words, the function is evaluated only if the package(s) are loaded. 换句话说,这个函数是仅仅评估,如果包(s)装载。If you want to specify multiple packages, separate them with comma.如果您想要指定多个包,用逗号分开。
    • fn -- the function to executefn -执行的那个函数

afterMountafterMount

void afterMount(Function fn);

Adds a function that will be executed after the mounting is done. 添加一个函数,将之后执行安装完成。By mounting we mean the creation of peer widgets. 通过挂载我们指的是创建小部件的同行。The function is executed immediately if the mounting has been done.这个函数是立即执行如果安装已经完成。

To know whether it is mounting, you can check知道究竟是安装,您可以检查#mounting#安装.

Notice that, unlike注意,不像#afterMount# afterMount, it never executes the function immediately.,它永远不会执行函数立即。

  • Parameters参数
    • fn the function to executefn执行的那个函数

ajaxURIajaxURI

String comURI(String uri, Map opts);

Encodes and returns the URI to communicate with the server.URI编码,并返回与服务器通信。

  • Example示例
1
document.createElement("script").src = zk.ajaxURI('/web/js/com/foo/mine.js',{au:true});
  • Parameters参数
    • uri - the URI related to the AU engine. uri - uri相关的非盟引擎。If null, the base URI is returned.如果为空,则返回的基url。
    • opts - [optional] the options:选择-[可选]选项:
      • au - whether to generate an URI for accessing the ZK update engine. 非盟-是否生成一个URI访问ZK更新引擎。If not specified, it is used to generate an URL to access any servlet如果未指定,它是用来生成一个URL访问任何servlet
      • desktop - the desktop or its ID. If null, the first desktop is used.桌面——桌面或它的ID。如果是null,第一个是台式电脑使用。
      • ignoreSession - whether to handle the session ID in the base URI.ignoreSession——是否处理会话ID的基url。

beforeUnloadbeforeUnload

void beforeUnload([[JavaScript Function|Function] fn, Map opts);

Adds a function that will be executed when the browser is about to unload the document. 添加一个函数将执行当浏览器即将卸下的文档。In other words, it is called when换句话说,它时被调用 window.onbeforeunloadis called.被称为。

To remove the function, invoke this method by specifying remove to the opts argument.删除函数,调用这个方法的参数指定删除选择。

1
zk.beforeUnload(fn, {remove: true});
  • Parameters参数
    • fn the function to execute. fn执行的那个函数。The function shall return null if it is OK to close, or a message (String) if it wants to show it to the end user for confirmatio.函数将返回null,是否可以关闭,或消息(字符串),如果它想要显示给最终用户的confirmatio。
    • opts a map of options:选择一个地图的选择:
      1. remove: whether to remove instead of add删除:是否移除而不是添加

copy复制

Map copy(Object destination, Map source);

Copies a map of properties (or options) from one map to another.复制属性的一个map(或选项)从一个映射到另一个。

  • Example: extending Array例子:扩展数组
1
2
3
4
5
zk.copy(Array.prototoype, {
$add: function (o) {
this.push(o);
}
});
  • Parameters参数
    • destination- the destination object to copy properties to.——目标对象复制属性。
    • source- the properties to copy from——属性,以复制
  • Returns the destination返回目的地

define定义

void define(zk.Class klass, Map props);

Defines the setter and getter methods.定义setter和getter方法。

Notice that you rarely need to invoke this method directly. 请注意,您根本不需要直接调用此方法。Rather, you can specify them in a property named $define, when calling相反,您可以指定它们在属性命名为$定义,当调用#$extends# $扩展.

For example, the following code snippet例如,下面的代码片段

1
2
3
zk.define(zul.wgt.Button, {
disabled: null
});

is equivalent to define three methods, isDisabled, getDisabled and setDisabled, as follows:相当于定义三个方法,isDisabled,getDisabled和setDisabled,如下:

1
2
3
4
5
6
7
8
9
10
zul.wgt.Button = zk.$extends(zk.Widget, {
isDisabled: _zkf = function () {
return this._disabled;
},
isDisabled: _zkf,
setDisabled: function (v) {
this._disabled = v;
return this;
}
});

If you want to do something when the value is changed in the setter, you can specify a function as the value in the props argument. 如果你想要做的事的值发生更改时在setter,您可以指定一个函数作为参数的值在道具。For example,例如,

1
2
3
4
5
zk.define(zul.wgt.Button, {
disabled: function () {
if (this.desktop) this.rerender();
}
});

will cause the setter to be equivalent to将导致setter相当于吗

1
2
3
4
5
6
setDisabled: function (v, opts) {
this._disabled = v;
if (this._disabled !== v || (opts && opts.force))
if (this.desktop) this.rerender();
return this;
}

If you want to pre-process the value, you can specify a two-element array. 如果你想进行预处理后的价值,您可以指定一个双元素数组。The first element is the function to pre-process the value, while the second is to post-process if the value is changed, as described above. 第一个元素是函数来对其进行预处理的价值,而第二个是后处理如果值发生更改,如上所述。For example,例如,

1
2
3
4
5
6
7
8
9
10
zk.define(zul.wgt.Button, {
disabled: [
function (v) {
return v != null && v != false;
},
function () {
if (this.desktop) this.rerender();
}
]
});

will cause the setter to equivalent to将导致setter去相当于吗

1
2
3
4
5
6
7
setDisabled: function (v) {
v = v != null && v != false;
this._disabled = v;
if (this._disabled !== v || (opts && opts.force))
if (this.desktop) this.rerender();
return this;
}

Notice that when the function (specified in props) is called, the arguments are the same as the arguments passed to the setter (including additional arguments. 注意,当这个函数(道具中指定)被调用,这些参数是相同的参数传递给setter(包括附加参数。For example, if例如,如果 button.setDisabled(true, false)is called, then the specified function is called with two arguments, true and false. 被调用,然后指定的是调用函数有两个参数,真与假。In additions, as shown above, you can enforce the invocation of the function by passing a此外,如上所示,您可以执行的函数调用通过一个map地图with force as true.用武力是真实的。

1
wgt.setSomething(somevalue, {force:true});
  • Parameters参数
    • props- a map of the properties whose getter and setter shall be defined. ——一个映射的属性的getter和setter应被定义。The name is the property name, such as href and width. 这个名字是属性名,如href和宽度。The value is either null or a function that will be invoked when the value is changed.这个值可以是null或一个函数,该函数将被调用的值发生更改时。

depends取决于

void depends(String dependentPkgnm, dependedPkgnm);

Declare a package that must be loaded when loading another package.声明一��包,必须加载当加载另一个包。

Notice that it doesn't guarantee the loading order of the two packages. 请注意,它并不保证加载顺序的两个包。Thus, it is better to do in因此,最好是在#afterLoad#增加if a code snippet depends on both packages.如果一个代码片断,既取决于包。

  • Parameter参数
    • dependentPkgnm - the name of the package that depends another package. dependentPkgnm——的包的名称取决于另一个包。In other words, calling换句话说,调用#loading#加载against this package will cause dependedPkgnn being loaded.反对这个计划将导致dependedPkgnn被加载。
    • dependedPkgnm: the name of the package that shall be loaded if another package is being loaded.dependedPkgnm的包的名称应当加载如果加载的是另一个包。
  • See Also看到也
    • afterLoad(pkgnm, fn)增加(pkgnm,fn)- it registers a function to be executed after the specified package is loaded. ——它会注册一个函数之后执行指定的包被加载。Notice that it doesn't cause the package to be loaded.请注意,它并不会导致包加载。

disableESCdisableESC

void disableESC();

Disable the default behavior of ESC. 禁用的默认行为,ESC。In other words, after called, the user cannot abort the loading from the server.换句话说,在调用时,用户不能中止从服务器加载。

enableESCenableESC

void enableESC();

Enables the default behavior of ESC (i.e., stop loading from the server).支持ESC的默认行为(例如,停止从服务器加载)。

endProcessingendProcessing

void endProcessing();

Clears a flag,扫清了国旗,#processing#处理, to indicate that it the processing has done. ,以表明它已经做了处理。It also removes a message, if any, that indicates "processing".它删除一条消息(如果有的话),表示“处理”。

  • Example:例子:
1
2
3
zk.startProcessing(1000);
//do the lengthy operation
zk.endProcessing();

error错误

void error(String msg);

Display an error message to indicate an error.显示一条错误消息,指示一个错误。

  • Example:例子:
1
zk.error('Oops! Something wrong:(');

 

errorDismisserrorDismiss

void errorDismiss();

Closes all error messages shown by关闭所有错误消息显示#error#错误.

  • Example:例子:
1
zk.errorDismiss();

 

get得到

Object get(Object obj, String name);

Retrieves a value from the specified property.检索值从指定的属性。

For example,例如, zk.get(obj, "x"): If getX or isX is defined in obj,:如果getX或isX定义在obj, obj.isX()or obj.getX()is returned. 返回。If not defined,如果没有定义, obj.xis returned.返回。

  • Example:例子:
1
zk.get(o, 'value');
  • Parameters参数
    • obj- The object to assign values to.——对象赋值到。
    • name- The property name- name属性
  • Returns the value of the property返回该属性的值

getHostgetHost

String getHost(String pkg, boolean js);

Returns the URI of the server (so called host) for the specified package.返回的URI服务器(也称为主机)为指定的包。

ZK Client Engine loads the packages from the same server that returns the HTML page. ZK客户引擎加载软件包的同一台服务器返回的HTML页面。If a package might be loaded from a different server, you can invoke如果一个包可能是加载自不同的服务器,您可以调用#setHost# setHostto specify it and then指定它,然后#getHost# getHostwill return the correct URL for the specified package.将返回正确的URL指定的包。

  • Parameters参数
    • js - whether the returned URL is used to load the JavaScript file.js——无论是返回的URL用来加载JavaScript文件。#load#负载will pass true to this argument to indicate the URI is used to load the JavaScript file. 这将传递true参数,用于表示该URI是用来加载JavaScript文件。However, if you just want the URL to send the request back (such as json-p with jQuery's json), don't pass anything (or pass false) to this argument.然而,如果你只是想要发送请求的URL返回(比如json-p与jQuery的json),不放过任何(或传递false)来支持这个论点。

isLoadedisLoaded

boolean isLoaded(String pkgnm, boolean includeLoading);

Tests if a package is loaded (or being loaded).如果一个包加载测试(或被加载)。

  • Parameters参数
    • pkgnm - the package namepkgnm -包的名称
    • includeLoading - [Optional] If true is specified, this method returns true if the package is loaded or being loaded. (可选的)includeLoading——如果真的是指定的,该方法将返回true,如果包是加载或被加载。If false or omitted, it returns true only if the package is loaded.如果错误或者忽略,被它只返回true,如果包是加载。

load负载

boolean load(String pkgnms, Function func);
boolean load(String pkgnms, zk.Desktop dt, Function func);

Loads the specified package(s). 装载指定的包(s)。This method is called automatically when这个方法时自动调用mounting安装the peer widgets. 同行的小部件。However, if an application developer wants to access JavaScript packages that are not loaded, he has to invoke this method.然而,如果应用程序开发者想要访问的JavaScript的软件包,是不会加载,他将会调用这个方法。

The loading of a package is asynchronous, so you cannot create the widget immediately. 加载一个包是异步的,所以你不能立即创建小部件。Rather, use the third argument, func, or use相反,使用第三个参数,func,或使用#afterLoad#增加to execute.执行。

1
2
3
zk.load('zul.utl', null, function () {
new zul.utl.Timer();
});
  • Parameters参数
    • pkgnms - the names of the package(s) to load. pkgnms -包的名称(s)加载。If multiple packages are specified, separate them with comma, such as "zul.utl,zul.wgt".如果多个包指定,用逗号分开,比如“zul.utl,zul.wgt”。
    • dt - [optional] the desktop used to get URI of the JavaScript file (dt -(可选的)桌面用于获取JavaScript文件的URI(zAu#comURI# comURI凿. If null, the first desktop is assumed.如果是null,第一个桌面是假设。
    • func - [optional] the function to execute after all packages are loaded. func -(可选的)函数来执行所有的包都被加载后。Ignored if omitted. 如果省略忽视。Notice that func won't be executed until all requested packages are loaded; not just what are specified here.注意,func才会执行所有请求的包是加载;不只是这里指定的是什么。
  • Returns true if all packages have been loaded (not just the specified ones), or false if any package is loading.返回true,如果所有的软件包被加载(不仅仅是指定的),或假如果任何包加载。

log日志

void log(vararg);

Logs an message for debugging purpose.日志消息用于调试目的。

  • Example:例子:
1
2
zk.log('reach here');
zk.log('value is", value);

parseInt方法

int parseInt(String value, int radix);

Parses a string to an integer.将一个字符串转换为整数。

It is the same as the built-in parseInt method except it handles NaN.它是一样的内置方法方法除了它处理南。

  • Parameters参数
    • value- the string to parse.——字符串解析。
    • radix- represent the base of the number in the string. ——代表基地的连续的数字。10 is assumed if omitted.10是假定如果省略。
  • Returns the number, or 0 if NaN.返回数字,或0如果南。

set设置

void set(Object obj, String name, Object value, Object extra);

Assigns a value to the specified property.将值指定给指定的属性。

For example,例如, zk.set(obj, "x", 123): If:如果 setXis defined in定义在 obj, obj.setX(123)is called. 被称为。If not defined,如果没有定义, obj.x = 123is called.被称为。

  • Example:例子:
1
zk.set(o, 'value', true); //set a single property
  • Parameters参数
    • obj- The object to assign values to.——对象赋值到。
    • name- The property name- name属性
    • value- The property value-属性值
    • extra- An extra argument to pass to the——一个额外的参数传递给 setXmethod as the extra argument (the second argument). 法作为额外的参数(第二个参数)。For example,例如, zk.set(obj, 'x', 123, true)invokes调用 obj.setX(123, true). It is meaningless if there is no corresponding set method.它是没有意义的,如果没有相应的设置方法。

startProcessingstartProcessing

void startProcessing(int timeout);

Set a flag,设置一个标志,#processing#处理, to indicate that it starts an processing. ,表明它将提供一个处理。It also shows a message to indicate "processing" after the specified timeout.它还显示了一个消息来指出“处理”经过特定的超时。

  • Example:例子:
1
2
3
zk.startProcessing(1000);
//do the lengthy operation
zk.endProcessing();
  • Parameters参数
    • timeout- the delay before showing a message to indicate "processing".之前——延迟显示一条消息来指出“处理”。

The message is shown immediately if omitted or 0.消息会立即显示如果省略或0。

setHostsetHost

void setHost(String hostURL, String updateURI, Array<String> packages);

Defines the URL of the host for serving the specified packages.定义了URL地址的主机服务指定的包。

  • Parameters参数
    • hostURL - the URL of the host (such ashostURL - URL地址的主机(如http://ajaxasservice-examples.appspot.comhttp://ajaxasservice-examples.appspot.com) that is used to send the request to (by use of, say, jQuery's json)),用于将请求发送到(通过使用的,也就是说,jQuery的json)
    • updateURI - the URI of the update engine (such as /zkau) that is used to load the JavaScript fileupdateURI - URI的更新引擎(如/ zkau),用于加载JavaScript文件
    • packages - a list of package names that are associated with the host specified in hostURL.包——一个列表的包名称,相关的hostURL中指定的主机。
<!-- NewPP limit report Preprocessor node count: 251/1000000 Post-expand include size: 0/2097152 bytes Template argument size: 0/2097152 bytes Expensive parser function count: 0/100 --><!-- Saved in parser cache with key wiki_old-mw_:pcache:idhash:48-0!1!0!!en!2!edit=0 and timestamp 20120706015350 --> <!-- end content -->
<!-- end of CONTENT div -->
<!-- end of MAIN CONTENT div -->
<!-- end of MBODY div --><!------------------------------------------------------------------------------------------------------------------------->
<!-- content actions --> <!-- End of content action --><!-- personal tools --> <!-- End of personalTools DIV --><!-- Footer -->
This page was last modified on 21 September 2010, at 11:50.该页最后修改2010年9月21日,11点50分。 This page has been accessed 10,321 times.这个页面被访问的10321倍。
    <!-- <li id="f-about"><a href="/wiki/Documentation:About" mce_href="/wiki/Documentation:About" title="Documentation:About">About Documentation</a> | </li> -->
  • Content is available under内容可用在Copyrights版权||
  • Disclaimers免责声明||
  • Modified by修改ZKZK
本文有道翻译,原文地址:http://docs.zkoss.org/wiki/CDG5:_zk
<!-- end of the FOOTER div -->
<!-- End of contentBottom DIV --><!------------------------------------------------------------------------------------------------------------------------->

<!-- end of the CONTAINER div --> <!-- Served in 0.195 secs. --><!-- Syntax -->

<script type="text/javascript"></script>

<!--<mce:script src="/skins/zk/syntaxhightlighter/shLegacy.js" mce_src="/skins/zk/syntaxhightlighter/shLegacy.js"></mce:script>-->

<script type="text/javascript"></script><script type="text/javascript"></script>

<!-- Google -->

<script type="text/javascript"></script><script type="text/javascript"></script><script type="text/javascript"></script>

<!-- Header -->

<script type="text/javascript"></script>

原文:

Defines the URL of the host for serving the specified packages.
更好的翻译建议
提交翻译建议
感谢您为有道提供建议^_^
Defines the URL of the host for serving the specified packages.

 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics