HI
I am using renderInTemplate() to nest some widget, in particular, grid inside a window, I discovered the following method is missing to replace # in case the widget is nested inside another and the inner one contains in its definition a template string, so I suggest to patch width in a similar way ( more testing by your side is needed but It permitted to remova a Uncaught Error: Invalid template:' error in my application )
public
function
renderInTemplate() {
$this
->isClientTemplate = true;
$output
=
$this
->render();
$this
->isClientTemplate = false;
$output
=
str_replace
(
'</script>'
,
'<\\/script>'
,
$output
);
// ADD THIS LINE to
Replace also hash to prevent Uncaught Error: Invalid template:'
return
str_replace
(
'#'
,
'\\#'
,
$output
);
}