Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
845
Close Button disappears when refreshing Partial view rendered in dialog box
posted

Hi,

I am trying to implement a partial view on an igDialog box. This view must be refreshed when clicking on a button in a cell of an igHierarchicalGrid.

The partial view and dialog are defined as follows:

<div id="dialog" hidden="hidden">

<p>

@**@

@Html.Partial("../PurchaseOrderEnquiry/POPackSize")

p>

div>

@(Html.Infragistics()

.Dialog()

.State(DialogState.Closed)

.ShowHeader(true)

.ShowCloseButton(true)

.Modal(true)

.ContentID("dialog")

.Height("500px")

.Width("380px")

.Render()

)

}

The button calls this JS function to refresh the view:

function OpenPopup(e) {

var POLineID = $(e).attr("data-id");

$("#dialog").load('@Url.Action("RefreshPackSize", "PurchaseOrderEnquiry")' + '?POLineID=' + POLineID);

$("#dialog").igDialog("open");

}

Here is the RefreshPackSize function in the Controller:

public ActionResult RefreshPackSize(int POLineID)

{

POEnquiryModel model = new POEnquiryModel();

model.PackSizeModel = new POEnquiryPackSizeModel();

model.PackSizeModel.POLineID = POLineID;

return PartialView("POPackSize", model);

}

The POPackSize PartialView definition:

@using Infragistics.Web.Mvc;

@model FashionCloud.Models.POEnquiryModel

@(Html.Infragistics().Loader()

.ScriptPath(Url.Content("~/Infragistics/js/"))

.CssPath(Url.Content("~/Infragistics/css/"))

.Theme("infragistics")

.Render()

)

<body>

<fieldset>

<legend>Filters</legend>

<p>

<img style="width: 100%" src="http://www.igniteui.com/images/samples/dialog-window/content.jpg" />

</p>

<p>

@using (Html.BeginForm())

{

if (@Model.PackSizeModel != null)

{

if (@Model.PackSizeModel.POLineID > 0)

{

@Html.LabelFor(m => m.PackSizeModel.POLineID)

@Html.Infragistics().TextEditorFor(m => m.PackSizeModel.POLineID).Width(200).MaxLength(26).Render()

}

}

}

</p>

</fieldset>

</body>

My problem:

If I change "return PartialView("POPackSize", model);" to "return PartialView("POPackSize");" i.e. without the "model" parameter, the default "Close" button is visible,

As soon as "model" is added back, the "Close" button is no longer visible, and the dialog can only be closed using 'ESC', however it will not open again without error (if closed with the "Close" button, it works fine though).

As you can see, I have tried to explicitly show the header and close button in the dialog definition on my view, but it doesn't seem to help.

What is happening to the "Close" button, and how can I get it to display permanently?

Thanks

Deon

Parents Reply Children
No Data