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

Don't understand what is missing with example view

5 Answers 67 Views
View
This is a migrated thread and some comments may be shown as answers.
Phil H.
Top achievements
Rank 2
Phil H. asked on 22 Jul 2014, 01:22 AM
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

5 Answers, 1 is accepted

Sort by
0
Petyo
Telerik team
answered on 22 Jul 2014, 01:40 PM
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!
 
0
Phil H.
Top achievements
Rank 2
answered on 22 Jul 2014, 04:08 PM
Hi Petyo:
I do not think it worked with or without the evalTemplate option.  I will upgrade and try.
Phil
0
Phil H.
Top achievements
Rank 2
answered on 22 Jul 2014, 11:05 PM
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
0
Accepted
Petyo
Telerik team
answered on 24 Jul 2014, 11:52 AM
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!
 
0
Phil H.
Top achievements
Rank 2
answered on 25 Jul 2014, 12:59 AM
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
Tags
View
Asked by
Phil H.
Top achievements
Rank 2
Answers by
Petyo
Telerik team
Phil H.
Top achievements
Rank 2
Share this question
or