This is a migrated thread and some comments may be shown as answers.

Get class name

1 Answer 143 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Matjaz
Top achievements
Rank 1
Matjaz asked on 29 Jun 2014, 10:36 AM
How can I get class name inside class function?
var Animal = kendo.Class.extend(
{
  getClassName: function()
  {
    console.log(???); //to get Animal
  }
});
var Bird = Animal.extend(
{
  getClassName: function()
  {
    console.log(???); //to get Bird
  }
});

I already try with this.constructor.name, but it is an empty string.

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 30 Jun 2014, 08:48 AM
Hello Matjaz,

kendo.Class does not have a method, which returns the object name. You can implement it in the subclasses' definitions.

Regards,
Dimo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
General Discussions
Asked by
Matjaz
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or