ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: YONGHOO KIM on May 14, 2020, 05:51:52 am

Title: dataType:date raw date format inquery
Post by: YONGHOO KIM on May 14, 2020, 05:51:52 am
Hi, param query
our raw data format is not "dd/mm/yyyy" also "yyyy-mm-dd"
Server returns like '20200514'.
How can I display on grid without change raw data?

{
   dataType: "date", format: "yy-mm-dd"
}


expected : Display "2020-05-14" in grid
actual: "NaN-NaN-NaN"
Title: Re: dataType:date raw date format inquery
Post by: paramvir on May 14, 2020, 09:05:02 am
grid expects date fields in ( mm/dd/yy or yy-mm-dd ) format for correct sorting, formatting, filtering, etc.

If it's not possible for you to make changes on server side, then you can correct the format in dataModel.getData callback.

https://paramquery.com/pro/api#option-dataModel-getData

Code: [Select]
dataModel: {
  getData: function( response ){
     //loop through respone.data and make changes in date fields.   
  }
}

Please let me know if you need further assistance on this.