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

Attaching Header information to Window.Content and changing request type to POST

1 Answer 234 Views
Window
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 24 Mar 2017, 08:51 PM

Hello, I have read through the documentation many times and believe I can accomplish what I want to do.  In fact, I have created a Dojo doing exactly what I want:

http://dojo.telerik.com/UDoZU

However, when I attempt to do this in my own software, I cannot even change the method request type from GET to POST.

I am attempting to create a Kendo Window and insert data inside of it from an API endpoint.  I need to set custom request headers for my data call in order to make the request.  So far, I've tried:

var window = document.createElement('div');
        $(window).kendoWindow();
        var dialog = $(window).data("kendoWindow");

        dialog.refresh({
            url: uri_UIManagement + 'Container/GetBuiltContainer' + urlString,
            type: 'POST',
            headers: headers,
            beforeSend: function (xhr) {
                debugger;
            }
        });

 

myWindow.kendoWindow({
            width: "600px",
            title: "About Alvar Aalto",
            content: {
                url: uri_UIManagement + 'Container/GetBuiltContainer' + urlString,
                type: "POST"
            },
            visible: false,
            actions: [
                "Pin",
                "Minimize",
                "Maximize",
                "Close"
            ]
        }).data("kendoWindow").center().open();

 

myWindow.data('kendoWindow').refresh({
            url: uri_UIManagement + 'Container/GetBuiltContainer' + urlString,
            type: 'POST',
            headers: headers,
            beforeSend: function (xhr) {
                debugger;
            }
        });

 

NONE of these methods allow me to hit the breakpoint I have set inside of beforeSend.  They don't even change the request type from GET to POST.  I can accomplish all of these things inside of the Kendo Dojo.  What am I missing?

1 Answer, 1 is accepted

Sort by
0
Ianko
Telerik team
answered on 28 Mar 2017, 07:55 AM

Hello Ryan,

The window variable is a reserved one and it is not one that can be used to instantiate different objects than the browser's window object. https://www.w3schools.com/js/js_reserved.asp

It is possible that this is the reason for the difficulties experienced. 

Regards,
Ianko
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Window
Asked by
Ryan
Top achievements
Rank 1
Answers by
Ianko
Telerik team
Share this question
or