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

No event.type?

1 Answer 32 Views
View
This is a migrated thread and some comments may be shown as answers.
Marlon
Top achievements
Rank 1
Marlon asked on 05 Jun 2015, 12:31 PM

Is there any way to determine the type of event from a function callback? I assumed there'd be a type defined but that doesn't seem to be the case. So if I define data-init="init" on my view and had this js:

 

init:function(e){
console.log(e.type, e.view.id, e);
}

 

e.type is not defined. I tried inspecting the object and couldn't find a parameter for it.

1 Answer, 1 is accepted

Sort by
0
Petyo
Telerik team
answered on 08 Jun 2015, 08:44 AM
Hello Marlon,

the init event is not a DOM event, so it does not feature type. In general, we don't encourage using single event handlers for multiple event types, so you may assume that this is an "init" event, especially given the binding you use. 

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