Hi,
Currently using version "2014.2.716"
I have code using the router 'init' method. I went looking for documentation on this method but couldn't find any... I could have sworn there used to be some somewhere. Is there documentation of this method somewhere?
Thanks,
Josh
Currently using version "2014.2.716"
I have code using the router 'init' method. I went looking for documentation on this method but couldn't find any... I could have sworn there used to be some somewhere. Is there documentation of this method somewhere?
Thanks,
Josh
6 Answers, 1 is accepted
0
Hello Josh,
Each widget has private init method that initializes the component. It is not recommended to call or modify that method which is why it is not documented.
Regards,
Alexander Valchev
Telerik
Each widget has private init method that initializes the component. It is not recommended to call or modify that method which is why it is not documented.
Regards,
Alexander Valchev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Josh
Top achievements
Rank 1
answered on 20 Mar 2015, 02:16 PM
Thanks Alexander.
Can you say why it is not recommended to utilize router.init? I find it quite useful for doing some UI and other initialization tasks before the first route is called.
.. Josh
Can you say why it is not recommended to utilize router.init? I find it quite useful for doing some UI and other initialization tasks before the first route is called.
.. Josh
0
Accepted
Hello Joshua,
Perhaps you refer to the router init event (which is different than the init method). Indeed, it is not a documented one; The init event will be triggered synchronously when you call the start() method, so you can put your code before the start method instead.
Regards,
Petyo
Telerik
Perhaps you refer to the router init event (which is different than the init method). Indeed, it is not a documented one; The init event will be triggered synchronously when you call the start() method, so you can put your code before the start method instead.
Regards,
Petyo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Josh
Top achievements
Rank 1
answered on 23 Mar 2015, 06:13 PM
Bah, right you are... sorry, I confused the event and method. Still, it seems you are recommending not using the init event and instead just put code before the start() method. Why is that? Putting initialization in the init event seems to be more clear.
0
Josh
Top achievements
Rank 1
answered on 24 Mar 2015, 01:25 PM
By the way, I finally tracked down where I saw the usage of the init event and why I was using it. It's in your very own sushi SPA demo:
So... why is it not recommended for use and also not documented?
var
sushi =
new
kendo.Router({
init:
function
() {
layout.render(
"#application"
);
}
});
So... why is it not recommended for use and also not documented?
0
Hi Joshua,
that's a good one! indeed we use it in the demo, and it is by mistake. The reason why we keep it undocumented is because it adds no additional objective value, while creating the false perception that the router has an asynchronous instantiation (which is not the case).
Regards,
Petyo
Telerik
that's a good one! indeed we use it in the demo, and it is by mistake. The reason why we keep it undocumented is because it adds no additional objective value, while creating the false perception that the router has an asynchronous instantiation (which is not the case).
Regards,
Petyo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!