datepicker in grid erases other datepicker on page

I have a form with a few fields, and a editable grid.

One of the fields is using DatePicker control. Also, one of the columns in the grid edited using DatePicker. When I set the value of the datepicker in the grid and update, the value in the other DatePicker is erased.

The demo is in the attachment.

Thanks, Tom

Attachment: datepickerbug_d9f454b8.zip

3 Replies

MS Madhu Sudhanan P Syncfusion Team October 22, 2018 10:32 AM UTC

Hi Tomislav Tustonic, 
 
Thanks for contacting Syncfusion support. 
 
We have checked your query and tried to reproduce the issue at our end but it is unsuccessful. From the code example shared, we have prepared a simple sample and the same can be downloaded from the below link. Please refer the below code example and sample link. 

[Index.cshtml] 
@using Syncfusion.EJ2 
@model mvc_ej2.Controllers.HomeController.TestViewModel 
 
@using (Html.BeginForm()) 
{ 
    @Html.EJS().DatePickerFor(m => m.Date1).Render(); 
    <hr /> 
 
    @(Html.EJS().Grid("FlatGrid").DataSource((IEnumerable<object>)ViewBag.dataSource).Width("auto").Columns(col => 
{ 
    col.Field("EmployeeID").IsPrimaryKey(true).Width("150").ValidationRules(new { required = "true" }).Add(); 
    col.Field("OrderDate").Format("yMd").EditType("datepickeredit").Width("150").Add(); 
 
}).AllowPaging().EditSettings(edit => { edit.AllowAdding(true).AllowEditing(true).AllowDeleting(true).Mode(Syncfusion.EJ2.Grids.EditMode.Normal); }).Toolbar(new List<string>() { "Add", "Edit", "Delete", "Update", "Cancel" }).Render() 
    ) 
 
} 

 
Please refer to the above sample and get back to us with more information such as product version, screenshot of developer tool console to check script error(if any) or you could also reproduce the issue in the attached sample and revert back to us, these information would be helpful for us to analyze and provide solution as earlier as possible. 

Regards, 
Madhu Sudhanan P 



TT Tomislav Tustonic October 22, 2018 12:17 PM UTC

Hello
Thanks for the sample., but it doesn't work in the Internet Explorer.
First, it needs a Promise polyfill. When I add
    <script src="https://cdn.jsdelivr.net/npm/promise-polyfill@8/dist/polyfill.min.js"></script>
in the _Layout.cshtml then I get 'Line 1: Unspecified error' when I click on the calendar icon.
So, I still couldn't make it work...

Tom


MS Madhu Sudhanan P Syncfusion Team October 23, 2018 12:00 PM UTC

Hi Tomislav, 

We are able to reproduce the reported problem when placing grid and date picker inside form element. We have considered “Datepicker value is reset after grid save operation” as bug and a support incident has been created under your account to track the status of this requirement. Please log on to our support website to check for further updates. 


Regards, 
Madhu Sudhanan. P 


Loader.
Up arrow icon