SHOW:
|
|
- or go back to the newest paste.
1 | <!DOCTYPE HTML> | |
2 | <html> | |
3 | <head> | |
4 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
5 | <title>qx.Classes Test</title> | |
6 | <script type="text/javascript" src="http://demo.qooxdoo.org/2.1/framework/qx-oo-2.1.min.js"></script> | |
7 | </head> | |
8 | <body style="background-color: rgb(219,230,253);"> | |
9 | <div id="test"> | |
10 | </div> | |
11 | <script type="text/javascript"> | |
12 | qx.Class.define("com.BaseClass", | |
13 | { | |
14 | extend : qx.core.Object, | |
15 | ||
16 | construct: function() { | |
17 | this._children = []; | |
18 | - | _children: [], |
18 | + | }, |
19 | ||
20 | members: | |
21 | { | |
22 | _children: null, | |
23 | ||
24 | getChildrenCount: function(){ | |
25 | return this._children.length; | |
26 | }, | |
27 | ||
28 | addChild: function(child){ | |
29 | this._children.push(child); | |
30 | } | |
31 | } | |
32 | }); | |
33 | ||
34 | var class1 = new com.BaseClass(); | |
35 | var class2 = new com.BaseClass(); | |
36 | console.log("class1.getChildrenCount() - " + class1.getChildrenCount()) | |
37 | console.log("class2.getChildrenCount() - " + class2.getChildrenCount()) | |
38 | class1.addChild("somechild"); | |
39 | console.log("class1.getChildrenCount() - " + class1.getChildrenCount()) | |
40 | console.log("class2.getChildrenCount() - " + class2.getChildrenCount()) | |
41 | </script> | |
42 | </body> | |
43 | </html> |