Pregunta

In Kendo Views, you can disabled the content being wrapped in a by feeding it the option { wrap: false }. This is documented here: http://docs.telerik.com/kendo-ui/api/framework/view#configuration-wrap

However, this option breaks Kendo layout when initialized with it. My understanding is the Kendo layout inherits view, so it should work the same way?

var layout = new kendo.Layout('<div id="body"></div>', { wrap: false });
layout.render("#main");
layout.showIn("#body", new kendo.View("<p>This is content</p>"));

There isn't any error message, just a blank screen. Removing the wrap option from the layout init works again, but I am trying to disable wrapping the layout with a dummy div.

http://jsfiddle.net/5SWYu/

¿Fue útil?

Solución

Wrap set to false relies that the template will have a single root element. I just updated the documentation to reflect this.

Otros consejos

wrap is a configuration parameter of View not of Layout. Your code should read:

var layout = new kendo.Layout('<div id="body"></div>');
layout.render("#main");
layout.showIn("#body", new kendo.View("<p>This is content</p>", { wrap: false }));

This is your JSFiddle modified : http://jsfiddle.net/OnaBai/5SWYu/1/

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top