admin管理员组文章数量:1415460
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
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
Share Improve this question edited Aug 17, 2011 at 7:32 Reporter 3,9365 gold badges35 silver badges49 bronze badges asked Aug 17, 2011 at 7:25 Eugene PetrovEugene Petrov 6511 gold badge6 silver badges14 bronze badges 1-
1
Just curious, but did you try with
c instanceof a
? That would work in Javascript. – troelskn Commented Aug 17, 2011 at 17:44
2 Answers
Reset to default 6(Based on @troelskn 's ment)
http://jsfiddle/miriam/ugQHB/
c instanceof A
returns true.
You can use isXtype method. See docs here: Ext.AbstractComponent
本文标签: javascriptHow to check whether one class is inhereted of another classStack Overflow
版权声明:本文标题:javascript - How to check whether one class is inhereted of another class? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745166117a2645689.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论