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

Can you have widgets without Application?

7 Answers 90 Views
Application
This is a migrated thread and some comments may be shown as answers.
Ken
Top achievements
Rank 1
Ken asked on 12 Apr 2013, 10:17 PM
I want to use durandal for my application/mvvm/routing model, so I want to avoid using new kendo.mobile.Application(). In my test SPA, I'm trying to create a tabstrip:
1.<div data-role="tabstrip">
2.    <a href="#home">Home</a>
3.    <a href="#details">Details</a>
4.</div>
However, not only does it not work in my durandal view, i can't even get it to work in my index.html, unless I call kendo.mobile.Application():

01.<body>
02.    <div data-role="view">
03.        <div data-role="tabstrip">
04.            <a href="#home">Home</a>
05.            <a href="#details">Details</a>
06.        </div>
07.    </div>
08. 
09.    <!-- snip -->
10. 
11.    <script>
12.        window.kendoMobileApplication = new kendo.mobile.Application();
13.    </script>
14.</body>

Is there a way I can "activate" the widgets without having to use the Application constructor/kendo views/etc.?




7 Answers, 1 is accepted

Sort by
0
Petyo
Telerik team
answered on 13 Apr 2013, 01:54 PM
Hi Kenneth,

I am afraid that most Kendo UI Mobile widgets needs a mobile application to be instantiated for various styling and functional purposes. You may consider looking into Kendo MVVM framework part,  which is supported out of the box in Kendo UI Mobile. 

All the best,
Petyo
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
David
Top achievements
Rank 1
answered on 19 Jul 2013, 11:39 PM
Hi Ken,

Did you figure this out? As soon as I add the kendo.mobile.Application call in my Durandal app it breaks it. If don't have that then the Kendo UI objects do not render. Is it possible to use Kendo Mobile with Durandal?!
0
David
Top achievements
Rank 1
answered on 20 Jul 2013, 05:28 AM
ps - I have posted here to try and figure out how to use Durandal and Kendo Mobile in a Phone Gap app
http://stackoverflow.com/questions/17758991/where-to-init-kendo-mobile-application-in-durandal
0
David
Top achievements
Rank 1
answered on 21 Jul 2013, 09:09 AM
I have created a simple Durandal 1.2 project which
highlights the problem with Kendo Mobile and Durandal (and PhoneGap, but irrelevant
here)), namely:

The only way to get the Mobile controls to render properly
is to call kendo.mobile.Application. However this cannot find the right HTML
element if it is put into a different file and loaded with Durandal.

I cannot find the right place to put this init code as it throws
this error:  “Uncaught Error: 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.”

I am using the Kendo bindings change suggested here:  http://durandaljs.com/documentation/KendoUI/

kendoIndex.html is NOT Durandal but shows how it should be
rendered if the kendo.mobile.Application is called correctly (Run this first to
see what we are trying to achieve)

Shell : Has the Kendo Layout which does not get rendered.

Home View: Has the simple Kendo Mobile view – this does not
get rendered.

About:  A simple HTML
page without Kendo

Source is on Guthub – if anyone can get Kendo Mobile working
with Durandal I would appreciate it (or at least confirm if it is impossible

https://github.com/rodneyjoyce/DurandalKendoMobile/tree/master/App
0
Petyo
Telerik team
answered on 23 Jul 2013, 06:17 PM
Hello Rodney,

As far as I am aware of the durandal building blocks, they overlap Kendo UI Mobile in many aspects (routing, SPA, etc) - I am not sure how the two projects may work together, in fact. My suggestion would be to contact the Durandal project maintainers. 

Regards,
Petyo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Ken
Top achievements
Rank 1
answered on 29 Jul 2013, 02:28 PM
Rodney,

No I've moved on to using AngularJS with KendoUI for web. I do know that Durandal is coming out with a new version imminently that replaces sammy as it's router, so you may not want to work too hard at this until the new version ships.

Ken 
0
David
Top achievements
Rank 1
answered on 29 Jul 2013, 10:35 PM
Thanks Ken.

I have come to the conclusion that they do not play well together in Kendo's current state.

Unfortunately it means I have had to replace Kendo with Twitter Bootstrap. 

I am hoping that over time Kendo components can be broken into the styling and the SPA components so that they can be used interchangeable.

But good idea - I will try this again with Durandal 2.0
Tags
Application
Asked by
Ken
Top achievements
Rank 1
Answers by
Petyo
Telerik team
David
Top achievements
Rank 1
Ken
Top achievements
Rank 1
Share this question
or