PDA

View Full Version : Why Base.borrow is a private method?



LesJ
11 Jul 2012, 12:18 PM
It would be more useful if it were public. The inline example indicates that it was intended to be public.

See the CheckboxGroup (http://docs.sencha.com/ext-js/4-1/source/CheckboxGroup2.html#Ext-form-CheckboxGroup)code showing another example how it's used (scroll to the bottom).


....
Ext.apply(Base, {
....


/**
* Borrow another class' members to the prototype of this class.
*
* Ext.define('Bank', {
* money: '$$$',
* printMoney: function() {
* alert('$$$$$$$');
* }
* });
*
* Ext.define('Thief', {
* ...
* });
*
* Thief.borrow(Bank, ['money', 'printMoney']);
*
* var steve = new Thief();
*
* alert(steve.money); // alerts '$$$'
* steve.printMoney(); // alerts '$$$$$$$'
*
* @param {Ext.Base} fromClass The class to borrow members from
* @param {Array/String} members The names of the members to borrow
* @return {Ext.Base} this
* @static
* @inheritable
* @private
*/
borrow: function(fromClass, members) {
...
},


EDIT 7/12
This looks like a simple doc issue, so I'll add a comment in the API doc.

scottmartin
16 Jul 2012, 4:45 PM
This looks like a simple doc issue, so I'll add a comment in the API doc.'

Thanks.

Scott