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

Your kendo mobile application element does not contain any direct child elements with data-role="view" attribute set. Make sure that you instantiate the mobile application using the correct container.

2 Answers 638 Views
Application
This is a migrated thread and some comments may be shown as answers.
aremuga
Top achievements
Rank 1
aremuga asked on 20 Nov 2012, 07:03 AM
In my mobile application, I got the above error when i replace Q2 kendo.mobile.min.js into Q3 kendo.mobile.min.js.
Thanks in advance.

2 Answers, 1 is accepted

Sort by
0
Fotis Papppas
Top achievements
Rank 2
answered on 30 Nov 2012, 11:25 PM
Hi aremuga,

I had exactly the same problem when I was trying to initialize my kendo mobile application with a 'div' that didn't have a direct child div with data-role="view". Exactly as the error message says. Do you have any link that this error is reproducable?
If you try to initialize with document.body mke sure that there is at least one div with data-role="view" inside the body tags and this div is direct child of body.

<body>
.
.
<div data-role="view">
</div>
.
.
<script type="text/javascript">
    var app = new kendo.mobile.Application(document.body);
</script>
</body>

Fotis
0
Andrew Paulson
Top achievements
Rank 2
answered on 14 Dec 2012, 09:47 PM
when i had this problem when i upgraded, i noticed that the application thought it had  had no default layout, when I added a layout and had the view reference it the view showed up as expected. 

http://demos.kendoui.com/mobile/view/index.html

Here's the demo. this is what i mimic'd, you can multiple Layouts to allow you to switch between button bars and tabstrips depending on your need. 

Use the data-layout attribute to specify which layout you want that view to use. when you use app.navigate("#myNextView"); you'll see it uses the layout you defined. 

i'm not sure if a requirement changed or if it was just a hierarchial bug in my HTML layout but once i defined the layouts i had intended function. 
Tags
Application
Asked by
aremuga
Top achievements
Rank 1
Answers by
Fotis Papppas
Top achievements
Rank 2
Andrew Paulson
Top achievements
Rank 2
Share this question
or