Hi,
I have one UI which uses jqxgrid to modify data, if i change any data one alert will come for confirming the changes. but for datetimeinput if i dont chage the date also alert was coming, somehow i could able to compare oldDate and newDate, if they are equal i have to retur false, if it is chnaged oly alert should come.
here im pastig piece of code, plss help me with this
{text: ‘SettlementDate’, datafield: ‘SettlementDate’, columntype: ‘datetimeinput’, cellsformat: ‘yyyy-MM-dd’,
initeditor: function (row, cellvalue, editor) {
oldV = cellvalue;
},
validation: function (cell, value) {
if (value== ”) {
return { result: false, message: “SettlementDate cannot be empty!” };
}
var newV = value;
var oldDate = oldV.getDate() +””+ oldV.getMonth() +””+ oldV.getFullYear();
var newDate = newV.getDate() +””+ newV.getMonth() +””+ newV.getFullYear();
// alert(oldDate+”,”+newDate);
if (oldDate == newDate) {
return false;
}
return true;
}
It shows “Entered value is not valid” error when functio returns false;
Thanks,
Akshatha