The kendo UI formatting gets lost when the same screen / template gets displayed for a second time.
On the first visit, the screen (attachment screenshot-1.png) shows the listview nicely formatted.
Then, the user clicks on the "Back" button and then redisplays the screen. The second time, the same screen shows with all formating stripped out (attached screenshot-2.png). When looking at the DOM tree, several wrapped kendo DIV elements are missing - like the ones with class km-scroll-container and km-listview-wrapper.
Any help greatly appreciated. A standalone test HTML page is also attached. Very easy to reproduce: just click on "View jail cards", go back, and click "View jail cards" again.
Here is the snippet that applies the template and navigates to that screen:
Another way to reproduce the error is to apply the templating and navigation twice, like this:
On the first visit, the screen (attachment screenshot-1.png) shows the listview nicely formatted.
Then, the user clicks on the "Back" button and then redisplays the screen. The second time, the same screen shows with all formating stripped out (attached screenshot-2.png). When looking at the DOM tree, several wrapped kendo DIV elements are missing - like the ones with class km-scroll-container and km-listview-wrapper.
Any help greatly appreciated. A standalone test HTML page is also attached. Very easy to reproduce: just click on "View jail cards", go back, and click "View jail cards" again.
Here is the snippet that applies the template and navigates to that screen:
var
templateContent = $(
"#tmpl_jailcard"
).html();
var
template = kendo.template(templateContent);
$(
"#scr_jailcard"
).html(template(data));
app.navigate(
"#scr_jailcard"
);<br>
var
templateContent = $(
"#tmpl_jailcard"
).html();
var
template = kendo.template(templateContent);
$(
"#scr_jailcard"
).html(template(data));
app.navigate(
"#scr_jailcard"
);
// The following simulates the problem by re-applying template and navigating to it
$(
"#scr_jailcard"
).html(template(data));
app.navigate(
"#scr_jailcard"
);