<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>
(四) kendo UI 模板控件template使用与注意事项
时间: 2024-10-31 00:37:23