PersianDatepicker problem by editing the GridInlineEdit?
Hi to all Friends
I've got to run PersianDatePicker using the following method in GridInlineEdit:
Index Code:
new Column { Bind = "MyDateTime",ClientFormat = ".EntDate", Header = "?????",Width = 130}Controller Code:
.Mod(o => o.Inline("<input type='text' style='width: 110px' class='Date' name='MyDateTime' placeholder='?????'/>")),
<script>
$(function () {
$(document).on('aweinlineedit', function() {
//usage
$(".Date").persianDatepicker();
});
});
</script>
private static object MapToGridModel(FactorDetails o)Now my problem is that when the OnClick Edit date Is Not displayed. All fields were filled, but Date is not displayed in its own field. Please Guide Me.
{
return
new
{
o.Price,
EntDate = DB.MiladiToShamsi(o.MyDateTime)
}
[HttpPost]
public ActionResult Edit(FactorDetails input)
{
if (ModelState.IsValid)
{
Factor factor = DB.GetFactorDetailsById(input.Id);
factor.Price=input.Price;
factor.MyDateTime = DB.ShamsiToMiladi(input.MyDateTime);
}
dear
asked
at 29 Aug 2016
-
you need to have MyDateTime property present in the grid Model ( add it in the MapToGridModel ), and in your format put value='#Value' (inside o.Inline('<input ...at 04 Sep 2016 Omu