(四) kendo UI 模板控件template使用与注意事项

<script id="index" type="text/x-kendo-template"></script>

=======================================================
<script id="index" type="text/x-kendo-template">
    <span>Hello World!</span>
</script>

<script>
    var index = new kendo.View('index');
    //var index = new kendo.View('<span>Hello World!</span>'); //直接写HTML代码
    index.render("#app");//显示
    //$("#app").append(index.render());//真正加入代码
    //$("#app").html($("#index").text()) //jQuery语法

    //var templateContent = $("#myTemplate").html(); 
    //var template = kendo.template(templateContent); 
    //var data = [{ name: "John", isAdmin: false },{ name: "Alex", isAdmin: true }]; 
    //var result = kendo.render(template, data); //render the template 
    //$("#users").html(result); //append the result to the page 

</script>
posted @ 2014-07-23 19:44  微波炉  阅读(1297)  评论(0编辑  收藏  举报