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

Why does mobile use data attribute initialization but web does not?

1 Answer 41 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 09 Jul 2014, 04:36 PM
How come to mobile documentation has switched to using "<div data-role="view">
<a href="#my-modal" data-rel="modalview" data-role="button">Open Modal</a>
</div>

<div data-role="modalview" id="my-modal" style="width: 200px; height: 200px;">
Hello!
</div>

<script>
new kendo.mobile.Application();
</script>" as the new format for initializing widgets whereas the web documentation only uses "<select id="multiselect" multiple="multiple">
<option>Item1</option>
<option>Item2</option>
</select>
<script>
$("#multiselect").kendoMultiSelect({
animation: false
});
</script>" to initialize?   Is there a reason why mobile is being done this way vs the javascript way?  My company used the javascript initialization way for almost all widgets since that was what the API documentation used to show.  Is javascript initialization no longer working in mobile?  Most of my widgets work fine still, but the modalView specifically behaves completely wrong when initialized in javascript.  Styles don't get applied at all.










1 Answer, 1 is accepted

Sort by
0
Petyo
Telerik team
answered on 11 Jul 2014, 07:05 AM
Hello Mark,

The declarative approach you describe was first introduced in Kendo UI Mobile, due to the application view management specifics and the widgets being instantiated on demand, the first time the view is displayed. Later, we exposed the same feature for the entire framework using kendo.init/kendo.bind.


However, certain mobile widgets (in particular the mobile view, the modalview, and the drawer) do not support instantiation as a plugin, due to their particular positioning in the DOM structure of the mobile application. Most mobile widgets support jQuery plugin initialization too - each widget getting started help topic features an example and a short notice on its supported usage.

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