Add client side HTML to a window

1 Answer 59 Views
Window
Justin
Top achievements
Rank 1
Justin asked on 15 Apr 2023, 04:18 PM

This feels like a REALLY stupid question, but why doesn't the following work with the Window component:

            this._window = new kendo.ui.Window($("#kendo-window")[0], {
                content: "<div style='width: 250px; height: 250px; border: dashed 1px red;></div>"
            });


This above code works fine (it opens the window) with the exception that rather than putting the HTML content into the window, it tries to load content from:  "https://{myurl}/%3Cdiv%20style='width:%20250px;%20height:%20250px;%20border:%20dashed%201px%20red;%3E%3C/div%3E?_=1681574731677". 

I hope that someone can laugh at me and tell me how to just load client side content without an AJAX call or an iFrame.

Thank you!

1 Answer, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 19 Apr 2023, 11:59 AM

Hello, Justin,

The content option is used to fetch the content remotely. What you specify as string will be treated as URL.

A possible approach would be to use the content method after the initialization of the Window (initially empty). Here is a small example to demonstrate.

Let me know how that works for you.

Regards,
Martin
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Window
Asked by
Justin
Top achievements
Rank 1
Answers by
Martin
Telerik team
Share this question
or