-
Paul
1
posts
Member since:
Jan 2011
Posted 01 Apr 2013
Link to this post
I'm working with the layout example and seem to be missing something very basic. If I run:
$(document).ready(function (){
var fooView = new kendo.View("<span>foo</span>");
var layout = new kendo.Layout("<header>Header</header><section id='content'></section><footer>Footer</footer>");
layout.render($("#app"));
layout.showIn("#content", fooView);
});
I get as expected:
Header
foo
Footer
What I can't figure out is the how to replace:
var fooView = new kendo.View("<span>foo</span>");
with an external file (i.e. foo.html that contains <span>foo</span>)
What is the syntax to load content from an external html file into the content section of a layout?
Thanks for your help.
-
-
163
posts
Member since:
Jan 2011
Posted 02 Apr 2013
Link to this post
Hello Paul,
you have to access that file with some Ajax call. For example, you can use jQuery's $.get method.
Michael G. Schneider
-
-
78
posts
Member since:
Nov 2012
Posted 02 Apr 2013
Link to this post
Another possibility is to use the require.js "text" plugin.
-