Hi,
Unable to access ‘data’ in formatData method of ‘dataAdapter’.
err : ‘data.JourneyDate’ is NULL.
I need to format a date field (JourneyDate) before ‘updaterow’ method gets called, (as the ‘updaterow’ method gets
called automatically while the user moves to next field in the row in the Grid).
below is the code,
var dataAdapter1 = new $.jqx.dataAdapter(source1,
{
formatData: function (data)
{
{
valu: new Date(parseInt(data.JourneyDate)).substr(6),
data.JourneyDate : valu.getMonth() + 1 + “/” + valu.getDate() + “/” + valu.getFullYear()
});
}
}
updaterow: function (rowid,rowdata,commit)
{
// synchronize with the server – send update command
{
$.ajax(
{
cache: false,
dataType: ‘json’,
url: ‘/Lead/Update’,
data: rowdata,
type: “POST”,
success: function (data, status, xhr)
{
commit(true);
},
error: function (jqXHR, textStatus, errorThrown)
{
alert(“Fails … “);
commit(false);
}
});
}
},
Thanks,
Keshavan