9

I'm using Ext4...

How to check whether one class is inherited of another class?

for example:

Ext.define("A", {});
Ext.define("B", { extend: "A" });
Ext.define("C", { extend: "B" });

var a = Ext.create("A");
var c = Ext.create("C");

I need something like this: c instanceof a

???

Thanks

Reporter
  • 3,897
  • 5
  • 33
  • 47
Eugene Petrov
  • 651
  • 1
  • 5
  • 14

2 Answers2

6

(Based on @troelskn 's comment)

http://jsfiddle.net/miriam/ugQHB/

c instanceof A

returns true.

Miriam
  • 969
  • 1
  • 6
  • 15
2

You can use isXtype method. See docs here: Ext.AbstractComponent

dbrin
  • 15,525
  • 4
  • 56
  • 83