Hi Mehvish,
Thanks for contacting Syncfusion support.
Query: TypeError: e.getDate is not a function.
The mentioned script error has been thrown due to that you are using a string value in the data source for the date column (Active). If we define column.type as the date in the column definition, then it will automatically convert the date string into a date object and the Grid is displayed the date value with your given format.
To resolve the mentioned issue we suggest you to convert the date string value into date object using the filter method of JavaScript. Using load event we have converted the Active column values into date objects to avoid the script error.
Please refer to the below code example and sample for more information.
|
function load() {
(this.grid.dataSource as any).filter(data => {
if (data.Active && typeof data.Active === "string") {
data.Active = new Date(data.Active);
}
});
} |
For more reference, please refer to the modified sample.
Note: If we use date string as like
T00:00:00.000Z , it is a part of
ISO-8601 date representation. So for this case if you set type as datetime in column level then it will be converted into the date object in source level. By default in EJ2 Grid the date column will be filter and sort properly when the values in
date object.
Please get back to us if you need further assistance with this.
Regards,
Thiyagu S