Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
144179 | Apr 23,2019 03:29 PM UTC | Apr 24,2019 09:46 AM UTC | Angular - EJ 2 | 1 |
![]() |
Tags: Grid |
[app.component.ts]
import { Component, OnInit, ViewChild } from '@angular/core';
import { DataUtil, DataManager } from "@syncfusion/ej2-data";
import { FilterService, GridComponent } from '@syncfusion/ej2-angular-grids';
var parseData = JSON.stringify(
[
. . . .
])
// Iterate value type from JSON stringify(parseData)
var orderDataSource = JSON.parse(parseData, (field: any, value: any) => {
let dupValue: any = value;
if (typeof value === 'string' && /^(\d{4}\-\d\d\-\d\d([tT][\d:\.]*){1})([zZ]|([+\-])(\d\d):?(\d\d))?$/.test(value)) {
let arr: any = dupValue.split(/[^0-9]/);
let arg: any = parseInt(arr[4], 10);
let arg1: any = parseInt(arr[5], 10);
value = new Date(parseInt(arr[0], 10), parseInt(arr[1], 10) - 1, parseInt(arr[2], 10), parseInt(arr[3], 10), arg, arg1);
}
return value;
});
@Component({
selector: 'my-app',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
providers: [FilterService]
})
ngOnInit() {
this.data = orderDataSource;
this.formatoptions = { type: 'date', format: 'dd/MM/yyyy' };
this.filterSettings = { type: "Menu" }
} |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.