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

2 posts, 0 answers
  1. Ryan
    Ryan avatar
    17 posts
    Member since:
    Oct 2016

    Posted 24 Mar Link to this post

    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?

  2. Ianko
    Admin
    Ianko avatar
    1729 posts

    Posted 28 Mar Link to this post

    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.
Back to Top