qooxdoo的事件处理机制相当简洁且不失灵活,qx.core.Target定义了如下3个常用的事件处理方法:
1. addEventListener
最简单的写法是
classInstance.addEventListener("eventName", functionPointer);
function functionPointer() {...};
当然你也可以用inline function
classInstance.addEventListener("eventName", functionPointer() {});
比如,偶们有一个button,希望 ...
Javascript语言本身并没有提供命名空间的机制,很多种Javascript Lib都有各自的模拟方法,在qooxdoo里面,命名空间是通过这个方法调用实现的:
qx.OO.defineClass("you.package.YourClassName", parentObject, initFunction);
举一个实际的例子来说明就很容易明白这个API的用法:
qooxdoo提供了qx.ui.component.DateChooser这个日期选择的类,他的界面如下:
它本身是直接嵌入页面的,而实际需求往往是一个popup date chooser window,偶们可以用 ...
http://gaame.blogspot.com/index.html







评论排行榜