Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ext.extend vs Ext.override?

Tags:

extjs

What is the difference between Ext.extend and Ext.override? In java, you extend a class and you override its methods. But looking at syntax, it seems in extjs, you can both extend a class and override a class

like image 821
Victor Avatar asked Feb 04 '11 19:02

Victor


2 Answers

Ext.extend gives you a new class basing on existing one.

Ext.override modifies existing class without creating a new one.

It's not something specific to ExtJS. It's how JavaScript's prototype-based object model works. It's quite different from what you're used to in Java. ExtJS just adds these two utility methods to make it a bit easier to use.

like image 81
Mchl Avatar answered Oct 04 '22 05:10

Mchl


Mchl has already answered to your query.

I just want to add, for adding features to ExtJs involves these four ways:

  1. Extend
  2. Override
  3. Plugin
  4. Sequence/Intercept

Please refer to this link for detail information:

http://www.slideshare.net/VinylFox/four-ways-to-add-features-to-ext-js

like image 27
Kunal Goel Avatar answered Oct 04 '22 06:10

Kunal Goel