I found a way to remove all modal views as well as remove the view itself on the view hide event... here's the code:
//remove modal views
$(
"div[data-role='modalview']"
).each(
function
() {
var
modalView = $(
this
).data(
"kendoMobileModalView"
);
if
(modalView) modalView.destroy();
var
$modalContainer =
null
;
$(
this
).parents().each(
function
() {
if
($(
this
).parent().prop(
"tagName"
) ==
"BODY"
) {
$modalContainer = $(
this
);
return
false
;
}
});
if
($modalContainer !=
null
&& $modalContainer.length > 0) $modalContainer.remove();
});
//remove view
var
$viewDiv = $(
'#'
+ e.view.content.context.id);
if
($viewDiv.length > 0) $viewDiv.remove();
if
(e.view) e.view.destroy();