In object-oriented programming, the term inheritance can be defined as a technique in which a subclass imports the superclass's properties.
In Ext JS, you can use inheritance in following two ways:
Inheritance with the help of Ext.extend method
- Ext.define (employeeApp.view.EmployeeDetailsGrid,
- // EmployeeDetailsGrid uses the feature of Ext JS GridPanel
- {
- extend : 'Ext.grid.GridPanel',
- ...
- });
Inheritance with the help of Mixins
The mixins keyword helps us to import the class A properties into class B. Usually, mixins are included in the controller, which contains the declaration of various classes such as store, view, etc.
- mixins : {
- Commons : 'DepartmentApp.utils.DepartmentUtils'
- };
You can also invoke DepartmentUtils class and use it inside the application.