We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Form is hidden on dialog template

When I use dialog template, the fieldset or div wrapping my model property controls is display:none.
Editing an existing record works fine.
 

        [HttpPost]
        public virtual ActionResult Index(PagingParams args, int? Id)
        {
            /// TODO: Refactor to use the template defined in the view
            /// There is a defect in Syncfusion where the GridRequestParams only post if a 'template' style editing mode is not used
            //var gridRequestParameters = System.Web.Helpers.Json.Decode(this.Request.Form["GridRequestParams"]);

            string dialogTemplateName = "D" + typeof(T).Name;
           
            RequestType currentRequest = (RequestType)Convert.ToInt32(args.RequestType);

            if (currentRequest == RequestType.BeginEdit && Id.HasValue)
            {
                T item =
                    (T)this.Repo.GetByFieldValue("Id", Id);
                return PartialView(dialogTemplateName, item);
            }

            else if (currentRequest == RequestType.BeginAddNew)
            {
                return PartialView(dialogTemplateName, new T());
            }
            else
            {
                return GetItems().GridActions<T>();
            }          
        }
        #endregion

 

 

DIALOG TEMPLATE VIEW -

@model My.Domain.Account


    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Account</legend>

        @Html.HiddenFor(model => model.Id)

        <div class="editor-label">
            @Html.LabelFor(model => model.Name)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Name)
            @Html.ValidationMessageFor(model => model.Name)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Address)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Address)
            @Html.ValidationMessageFor(model => model.Address)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.City)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.City)
            @Html.ValidationMessageFor(model => model.City)
        </div>

    </fieldset>

 


3 Replies

AM Abdul Matin M Syncfusion Team October 30, 2013 11:26 AM UTC

Hi Jeremy,

 

Thanks for using Syncfusion products.

 

We are sorry for the inconvenience caused. We have created a simple sample based on the code snippet you have provided but we are unable to reproduce the issue. For your convenience we have attached the sample and the same can be downloaded from the link below.

 

Could you please replicate the issue in the below sample and get back to us with more information to reproduce your issue so that we could able to sort out the cause of this issue and provide you a better solutions quickly?. The information provided would be a great help for us to resolve this issue.

 

Please let us know if you need any further assistance.

 

Regards,

Abdul Matin M



DialogTemplateEditingSample_7858d9e6.zip


JB Jeremy Branham November 3, 2013 09:15 PM UTC

Thanks, I found a javascript function I had was hiding the element after the partial view was rendered.


HJ Hariharan J V Syncfusion Team November 8, 2013 07:10 AM UTC

Hi Jeremy,

Thanks for your update.

Could you please confirm whether the reported issue has been resolved?

Please let us know if you need any further assistance.

Regards,
Hariharan J.V.

Loader.
Live Chat Icon For mobile
Up arrow icon