Don't understand what is missing with example view

6 posts, 1 answers
  1. Phil H.
    Phil H. avatar
    88 posts
    Member since:
    Nov 2008

    Posted 21 Jul 2014 Link to this post

    Hi:

    I pasted one of your examples into a page (slight modification) as follow:
    <div id="app"></div>
    <script>
        var foo = { foo: "bar" }
        var view = new kendo.View('<span>#: foo #</span>', { model: foo, evalTemplate: true });
        view.render($("#app"));
    </script>
    and it displays on the screen:
    #: foo #
    I was expecting bar, but it seems it is not binding.  I have version v2014.1.318.
    Phil
  2. Petyo
    Admin
    Petyo avatar
    2439 posts

    Posted 22 Jul 2014 Link to this post

    Hello,

    The evalTemplate option is a new one, available from the current official release (Q2 2014). 

    Regards,
    Petyo
    Telerik
     
    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. Phil H.
    Phil H. avatar
    88 posts
    Member since:
    Nov 2008

    Posted 22 Jul 2014 in reply to Petyo Link to this post

    Hi Petyo:
    I do not think it worked with or without the evalTemplate option.  I will upgrade and try.
    Phil
  5. Phil H.
    Phil H. avatar
    88 posts
    Member since:
    Nov 2008

    Posted 22 Jul 2014 in reply to Phil H. Link to this post

    Hi Petyo:
    I tried it with v2014.2.716, it output the same.
    <!DOCTYPE html>
    <head>
        <title>View - 01</title>
        <script src="../../scripts/jquery-1.8.2.min.js"></script>
        <link href="./content/base.css" rel="stylesheet" />
        <!-- Common Kendo UI Web CSS -->
        <link href="../../content/kendo/kendo.common-bootstrap.min.css" rel="stylesheet" />
        <!-- Default Kendo UI Web theme CSS -->
        <link href="../../content/kendo/kendo.blueopal.min.css" rel="stylesheet" />
        <!-- jQuery JavaScript -->
        <script src="../../scripts/jquery-1.8.2.min.js"></script>
        <script src="../scripts/underscore-min.js"></script>
        <!-- Kendo UI Web combined JavaScript -->
        <script src="../../scripts/kendo/kendo.all.js"></script>
    </head>
    <body>
        <div id="app"></div>
        <script>
            var foo = { foo: "bar" }
            var view = new kendo.View('<span>#: foo #</span>', { model: foo, evalTemplate: true });
            view.render($("#app"));
        </script>
    </body>
    </html>
    It is taken from your web-site.  http://docs.telerik.com/kendo-ui/api/framework/view
    Phil
  6. Answer
    Petyo
    Admin
    Petyo avatar
    2439 posts

    Posted 24 Jul 2014 Link to this post

    Hello Phil,

    Apologies for that, the documentation is wrong, and, in fact, showcases that the feature is limited to script templates. We will update it as soon as possible. Meanwhile, check this working example which uses a script template for the view.

    Regards,
    Petyo
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  7. Phil H.
    Phil H. avatar
    88 posts
    Member since:
    Nov 2008

    Posted 24 Jul 2014 in reply to Petyo Link to this post

    Hi Petyo:

    The following works:
    <div id="app"></div>
    <script>
        var foo = { foo: "bar" }
        var view = new kendo.View('foo-#: foo #', { model: foo, evalTemplate: true });
        view.render("#app");
    </script>

    Phil
Back to Top
Kendo UI is VS 2017 Ready