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

kendo.init() not working

1 Answer 233 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Gurumurthy
Top achievements
Rank 1
Gurumurthy asked on 04 Feb 2013, 05:59 PM
Hello - This question is regarding the usage of kendo.init() method in a mobile app. I am trying to inject some kendo ui markup using an ajax call, *after* the kendo app has been instantiated. For brevity's sake, I am showing some oversimplified code, see below:

<div id="container" data-role="content">
<ul data-role="listview" id="mylist">
<li> item 1 </li>
<li> item 2 </li>
<li> item 3  </li>
<li> item 4  </li>
</ul>
</div>    


Once the ajax call has returned and the above code has been appended to the kendo view, I am doing the following:

kendo.init($("#container");

This, however doesn't seem to work - the list looks like an HTML list and not a Kendo listview widget. On the other hand, if I individually initialize the listview widget using $("#mylist").kendoMobileListView(), it works.

Could you provide an explanation to this? 

I am using the init() method as described in the docs (http://docs.kendoui.com/getting-started/data-attribute-initialization). I am also curious to know why the init() method is not in the API reference.

Thanks,

1 Answer, 1 is accepted

Sort by
0
Petyo
Telerik team
answered on 05 Feb 2013, 08:36 AM
Hi Gurumurthy,

Details about kendo init and its usage can be found in this article. By default, mobile widgets are not initialized. You may also try using the kendo.mobile.init, which initializes mobile widgets by default. 

Greetings,
Petyo
the Telerik team
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
Gurumurthy
Top achievements
Rank 1
Answers by
Petyo
Telerik team
Share this question
or