0
votes

I am trying to load different static html files into a KendoWindow based on a link the user clicks. I am using the following to load the content.

$(document.body).append('<div id="formWindow"></div>');

$('#formWindow').kendoWindow({
    visible: false,
    iframe: true,
    height: "auto",
    maxWidth: 700,
    title: noticeTitle,
    modal: true,
    resizable: true,
    width: 700,
    refresh: function() {
      this.center();
    },
    close: function(e) {
      var dialog = $("#formWindow").data("kendoWindow");
      dialog.destroy();
    },
    content: formContent
});

When I use "iframe: false", the window size (height) is the correct size. However I need an iframe because sometimes the loaded page is a form for submitting data and I don't want the whole browser page to change, just the contents of the KendoWindow. When "iframe: true" is used, the KendoWindow size is almost the height of the browser screen (i.e. way too tall).

I would like to be able to adjust the window to fit the dynamically loaded contents, but I cannot figure out how to use JavaScript or JQuery to get the height of the window contents.

My content is always balanced tags and a page fragment (i.e. no tags).

Thanks!

1

1 Answers