@{
………………
string datePattern = CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern;
}
@(Html.EJ().Grid<object>("FlatGrid")
…………….
.Columns(col =>
{
…………………………………………
col.Field("OrderDate").HeaderText("Order Date").TextAlign(TextAlign.Right).Width(100).Format("{0:" + datePattern + "}").EditType(EditingType.DateTimePicker).Add();
})
)
<script>
function complete(args) {
if (args.requestType == "beginedit" || args.requestType == "add") {
$("#FlatGridOrderDate").ejDatePicker({ // Grid ID followed by the field name.
locale: "@CultureInfo.CurrentCulture.TextInfo.CultureName",
width: '100%'
});
}
}
</script> |
Hi Luca,
We are unable to reported problem at our end even at the latest version. We need some more additional details to find the cause of the issue. Share us the following details.
- If possible replicate the issue in the above sample and revert us back.
- Share us the video Demo to replicate the issue.
- Share your Layout page.
Regards,Farveen sulthana T
@(Html.EJ().Grid<object>("Grid")
…………………………..
.Columns(col =>
{
………………
});
)
<script>
jQuery.validator.methods["date"] = function (value, element) {
return true;
}
</script>
|
Hi Luca,
Thanks for the update.
Grid uses the jquery.validate for validating the form fields. In this case, the change in the format of the Grid column fields will be validated differently by the jquery.validate. Due to this the reported issue will occur, in order to avoid the reported issue we suggest you to return the jquery validate as mentioned below.
@(Html.EJ().Grid<object>("Grid")…………………………...Columns(col =>{………………});)<script>jQuery.validator.methods["date"] = function (value, element) {return true;}</script>
Regards,Manivannan Padmanaban.
Hi Luca,
As per your request, we have added the solution in the separate js file. Kindly refer the below link for js file.
Note: Refer the above js file after the ej.web.all.min.js reference.
Regards,Manivannan Padmanaban.