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
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745166118a4614640.html
评论列表(0条)