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

Submit child window and leave parent window open.

2 Answers 40 Views
Window
This is a migrated thread and some comments may be shown as answers.
Lee
Top achievements
Rank 1
Lee asked on 04 Jun 2015, 11:46 AM

Hi,

 I have an MVC site using Kendo that shows a popup window when a button is clicked.

This window has a textbox and another button. When the button is clicked another popup window is opened, so we now have 2 popup windows open.

The 2nd popup contains a grid and 2 hidden textboxes that are populated when an item is selected in the grid.

What needs to happen is:

When I submit the popup with the grid, I need to update the model and close it, but leave the parent popup open and populate the textbox with the content of one of the hidden textboxes.

My problem is:

I submit the child popup, but I cannot force the parent popup to stay open and update. I get errors if I call the popup directly and if I call the index the model is updated, but the parent popup is also closed.

 If anyone can understand what I have written, please help!?!?

Thanks,

Lee

2 Answers, 1 is accepted

Sort by
0
Lee
Top achievements
Rank 1
answered on 04 Jun 2015, 12:01 PM

As a note I am using Kendo wrappers.

The code in the parent window to open the child window is:

<div>
@(Html.Kendo()
.TextBox()
.Value(Model.SelectedLocationName)
.HtmlAttributes(new { @style = "float: left; width: 250px;" })
.Name("LocationDisplay"))

@(Html.Kendo()
.Button()
.Name("SelectLocation")
.Content("Select Location")
.Events(ev => ev.Click("open_Window"))
.HtmlAttributes(new { @style = "float: left; margin-left: 5px;", action = "GetLocation", controller = "Start", control = "locationSelection" }))
</div>
<div style="display: none" class="popup">
@(Html.Kendo().Window()
.Name("locationSelection")
.Title("Select Location")
.Width(600)
.HtmlAttributes(new { style = "height: 70%;"})
.Modal(true)
.Content(@Html.Partial("_LocationSelectionWidget").ToHtmlString())
.Draggable()
.Resizable()
)
</div>

0
Daniel
Telerik team
answered on 08 Jun 2015, 08:08 AM
Hello Lee,

I am not sure if I understand to which action is the grid popup submitted but you should render the index view with the updated model and use the Visible method to leave the parent popup opened when the data is submitted:
@(Html.Kendo().Window()
    .Name("locationSelection")
    ...
    .Visible(ViewBag.IsPosted)
)


Regards,
Daniel
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Window
Asked by
Lee
Top achievements
Rank 1
Answers by
Lee
Top achievements
Rank 1
Daniel
Telerik team
Share this question
or