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

How to set content-url and width of window in javascript?

1 Answer 1229 Views
Window
This is a migrated thread and some comments may be shown as answers.
Vincent
Top achievements
Rank 1
Iron
Vincent asked on 02 Jun 2018, 07:19 AM

How to set urlcontent and width of window in javascript?

I have a window as follow:

    <kendo-window name="WdAddCategory"  modal="true"
                  content-url="@Url.Content("~/Setting/Dictionary_Add/1")"
                  width="400"  visible="false"/>

and I open It in script:

        var window = $("#WdAddCategory").data("kendoWindow");
        window.open().center();

 

I want to change the content-url and width when I open it .how can I do that?

 


1 Answer, 1 is accepted

Sort by
0
Nencho
Telerik team
answered on 06 Jun 2018, 12:00 PM
Hello Vincent,

In order to achieve the desired functionality, you should use the refresh method of the Window and set the new url option:

https://docs.telerik.com/kendo-ui/api/javascript/ui/window/methods/refresh

As for the width - you can use the setOptions method of the kendoWindow and define the new width:

https://docs.telerik.com/kendo-ui/api/javascript/ui/window/methods/setoptions

For example:

var window = $("#WdAddCategory").data("kendoWindow");
window.setOptions({width:"50px"})

Hope this would help.

Regards,
Nencho
Progress Telerik
Try our brand new, jQuery-free Angular 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
Vincent
Top achievements
Rank 1
Iron
Answers by
Nencho
Telerik team
Share this question
or