Can you have widgets without Application?

8 posts, 0 answers
  1. Ken
    Ken avatar
    3 posts
    Member since:
    Oct 2009

    Posted 12 Apr 2013 Link to this post

    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.?




  2. Petyo
    Admin
    Petyo avatar
    2439 posts

    Posted 13 Apr 2013 Link to this post

    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!
  3. Kendo UI is VS 2017 Ready
  4. David
    David avatar
    18 posts
    Member since:
    Jan 2011

    Posted 19 Jul 2013 Link to this post

    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?!
  5. David
    David avatar
    18 posts
    Member since:
    Jan 2011

    Posted 20 Jul 2013 Link to this post

    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
  6. David
    David avatar
    18 posts
    Member since:
    Jan 2011

    Posted 21 Jul 2013 Link to this post

    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
  7. Petyo
    Admin
    Petyo avatar
    2439 posts

    Posted 23 Jul 2013 Link to this post

    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!
  8. Ken
    Ken avatar
    3 posts
    Member since:
    Oct 2009

    Posted 29 Jul 2013 Link to this post

    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 
  9. David
    David avatar
    18 posts
    Member since:
    Jan 2011

    Posted 29 Jul 2013 Link to this post

    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
Back to Top
Kendo UI is VS 2017 Ready