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

Non-iframe window with partial view content

1 Answer 140 Views
Window
This is a migrated thread and some comments may be shown as answers.
DAVID
Top achievements
Rank 1
DAVID asked on 14 Apr 2016, 03:27 PM

Hello,

I've been trying to implement the following (I believe quite common) scenario:

I have a page with a Grid in it and an Window, declared like this:

@(Html.Kendo().Window()
    .Name("detailsWindow")
    .Title(Localizer["Manage an Object"])
    .Content(Localizer["Loading..."])
    .AutoFocus(true)
    .Iframe(false)
    .Draggable()
    .Events(ev => ev.Close("detailsWindow_close"))
    .Resizable()
    .Visible(false)
    .Deferred()
)

 When the user double-clicks, the Window is refreshed with an URL of a partial view, the Window is centered and shown like this:

var detailsWindow = $('#detailsWindow').data('kendoWindow');
kendoWindow.refresh(url).center().open();

The problem is that nothing seems to work in the contents of the Window:

  • Kendo UI Date Time Pickers are not styled;
  • The culture is not applied.

Obviously Kendo UI Javascripts are not applied to the new DOM elements in the Window.

My question is: Can I refresh Kendo UI somehow (preferably to the DOM elements in the Window only)?

Note: I have intentionally disabled iframes, because:

  • I want to reduce markup going down the wire
  • I use AJAX forms in the Window
  • I reuse the actions and emit a regular view or a partial view depending on the request type.

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Dimo
Telerik team
answered on 18 Apr 2016, 11:24 AM
Hi Ilian,

The provided information suggests one of the following:

- the partial view content inside the Window already exists somewhere else on the page.
- the page contains widgets or elements with duplicate IDs

As a result, the widgets with duplicate Names (IDs) cannot be initialized. Web standards prohibit the usage of duplicate IDs, so please ensure that such a situation does not occur.

http://docs.telerik.com/kendo-ui/aspnet-mvc/fundamentals#configuration-Name

If the above information does not apply to your scenario and there are no JavaScript errors either, please send us an isolated runnable example for inspection.

Regards,
Dimo
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Window
Asked by
DAVID
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or