开发者

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

开发者 https://www.devze.com 2023-03-28 10:31 出处:网络
I\'m using Ext4... How to check whether one class is inherited of another class? for example: Ext.define(\"A\", {});

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


(Based on @troelskn 's comment)

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

c instanceof A

returns true.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消