This is a migrated thread and some comments may be shown as answers.

undefined with using AJAX functionality

2 Answers 377 Views
Window
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 17 Feb 2012, 10:00 PM
I am trying to load a page using AJAX, then display that page in a kendo window  when a button is clicked. However, the center() and open() functions do not work as the object is undefined. When omitting 'content' from the declaration the window shows ok. There is a div in the html with an id "window".

<script type="text/javascript">
      $(document).ready(function () {
          var window = $("#window");
 
          if (!window.data("kendoWindow")) {
                  window.kendoWindow({
                  actions: ["Refresh", "Maximize", "Minimize", "Close"],
                  content: "/ReportType/Create",
                  title: "Create a New ReportType",
                  modal: true,
                  visible: false
              });
          }
      });
  $("#createButton").click(function () {
      var window = $("#window").data("kendoWindow");
      window.center();
      window.open();
  });


2 Answers, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 20 Feb 2012, 12:45 PM
Hello John,

This is a commonly encountered problem with the window, caused by loading a page with a jQuery reference in it. Please refer to the troubleshooting help topic for the possible work-arounds.

Regards,
Alex Gyoshev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Ahmed
Top achievements
Rank 1
answered on 09 Apr 2012, 09:10 AM
This solution worked fine for me.

I was getting the same problem on center and open.

Removed jquery.min.js reference from my AJAX page and it started to work with both solutions mentioned by Alex. 

Sol1 :
$("#dialog").kendoWinodow({
// load complete page...
content
: "/foo",
// ... and show it in an iframe
iframe
: true
});

Sol2:
$("#dialog").kendoWinodow({
// load partial page, without jQuery reference
content
: "/foo"
});
Tags
Window
Asked by
John
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Ahmed
Top achievements
Rank 1
Share this question
or