Won't Fix
Last Updated: 18 Oct 2016 11:25 by ADMIN
ADMIN
Marin Bratanov
Created on: 26 May 2014 10:55
Category: Window
Type: Bug Report
0
FIX A RadWindow created client-side does not generate its ContentTemplate when set_contentElement() is called
The ContentTemplate is designed as a container for server controls, so you would need to declare and use a RadWindow with a ContenTemplate (even blank) for this to work as expected. The ContentTemplate element is not created upon client-side setting at this point, so having a content that is not where it is supposed to be may break the control afterwards (e.g., if autosizing is used).

A workaround is to create a dummy content template that can alleviate most issues:
var wnd = radopen(null, wndName);

//create an imitation of the ContentTemplate
if (!wnd.___customContentElemCreated) {
$telerik.$("iframe", wnd.get_popupElement()).remove();

var cElem = document.createElement("div");
cElem.setAttribute("id", wnd.get_id() + "_C");
cElem.style.display = "";
cElem.style.overflow = "auto";
cElem.style.border = "0px";
wnd.set_contentElement(cElem);
wnd.setWidthDockMode(wnd.get_width());
wnd.setHeightDockMode(wnd.get_height());

wnd.___customContentElemCreated = true;
}

wnd,set_contentElement(theNewElem);
1 comment
ADMIN
Marin Bratanov
Posted on: 18 Oct 2016 11:25
The problem has high complexity and low demand. A fix is likely to introduce regression issues and/or not handle all cases. Generally, the ContentTemplate is designed for server controls, so it should be declared on the server. If you cannot use named RadWindow instances declared on the server, you can try the workaround above or consider using a content page.