Alien-Web-ExtJS-V3
view release on metacpan or search on metacpan
share/src/ext-core/src/core/Ext.js view on Meta::CPAN
},
addMembers: function (cls, target, members, handleNonEnumerables) {
var i, name, member;
for (name in members) {
if (members.hasOwnProperty(name)) {
member = members[name];
if (typeof member == 'function') {
member.$owner = cls;
member.$name = name;
}
target[name] = member;
}
}
if (handleNonEnumerables && nonEnumerables) {
for (i = nonEnumerables.length; i-- > 0; ) {
name = nonEnumerables[i];
if (members.hasOwnProperty(name)) {
member = members[name];
if (typeof member == 'function') {
member.$owner = cls;
member.$name = name;
}
target[name] = member;
}
}
}
},
/**
* @method
* Defines a class or override. A basic class is defined like this:
*
* Ext.define('My.awesome.Class', {
* someProperty: 'something',
*
* someMethod: function(s) {
* alert(s + this.someProperty);
* }
*
* ...
* });
*
* var obj = new My.awesome.Class();
*
* obj.someMethod('Say '); // alerts 'Say something'
*
* To create an anonymous class, pass `null` for the `className`:
*
* Ext.define(null, {
* constructor: function () {
* // ...
* }
* });
*
* In some cases, it is helpful to create a nested scope to contain some private
* properties. The best way to do this is to pass a function instead of an object
* as the second parameter. This function will be called to produce the class
* body:
*
* Ext.define('MyApp.foo.Bar', function () {
* var id = 0;
*
* return {
* nextId: function () {
* return ++id;
* }
* };
* });
*
* When using this form of `Ext.define`, the function is passed a reference to its
* class. This can be used as an efficient way to access any static properties you
* may have:
*
* Ext.define('MyApp.foo.Bar', function (Bar) {
* return {
* statics: {
* staticMethod: function () {
* // ...
* }
* },
*
* method: function () {
* return Bar.staticMethod();
* }
* };
* });
*
* To define an override, include the `override` property. The content of an
* override is aggregated with the specified class in order to extend or modify
* that class. This can be as simple as setting default property values or it can
* extend and/or replace methods. This can also extend the statics of the class.
*
* One use for an override is to break a large class into manageable pieces.
*
* // File: /src/app/Panel.js
*
* Ext.define('My.app.Panel', {
* extend: 'Ext.panel.Panel',
*
* constructor: function (config) {
* this.callParent(arguments); // calls Ext.panel.Panel's constructor
* //...
* },
*
* statics: {
* method: function () {
* return 'abc';
* }
* }
* });
*
* // File: /src/app/PanelPart2.js
* Ext.define('My.app.PanelPart2', {
* override: 'My.app.Panel',
*
* constructor: function (config) {
( run in 0.879 second using v1.01-cache-2.11-cpan-787462296c9 )