I have couple of grids that extend AbstractFormGrid. Having an object (that could be grid or not) how to check if this object extends AbstractFormGrid. I managed to get object class name using Ext.getName(object) or object.self.getName() but i am unable to get"parent" class.
A subclass is a class that “extends” an existing class; that is, it has the attributes and methods of the existing class, plus more.
The Class object has a getName() method that returns the name of the class. So your displayClass() method can call getClass(), and then getName() on the Class object, to get the name of the class of the object it finds itself in.
The simplest way is to call the getClass() method that returns the class's name or interface represented by an object that is not an array. We can also use getSimpleName() or getCanonicalName() , which returns the simple name (as in source code) and canonical name of the underlying class, respectively.
The parent() method is used to return all ancestor of the selected elements. Check if ancestor (parent) class exist then it returns the class name otherwise returns not exist.
The property this.superclass
will return the parent class.
And as you mentioned this works:
Ext.getClass(object).superclass.self.getName()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With