Вот простой пример наследования
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
// Определяем класс родителя Ext.define('Parent', { someproperty:"testproperty", somemethod: function(text){ alert(text);}, somemethod2:function(text){alert(text);} }); // Определяем класс ребенка Ext.define('Children', { extend: 'Parent', //Демо вызова метода родителя с параметрами из ребенка somemethod2: function(text) { this.callParent(["modified argument from children "+text]); } }); var myinstance=Ext.create('Children');// Создаем экземпляр класса alert('parent property called from the children '+myinstance.someproperty); myinstance.somemethod('testword'); //Вызываем метод myinstance.somemethod2('testword');// Вызываем метод |