v12.0p_2020-02-02/LGPL Deployment
We are only using the JS side of the SmartClient product with a .NET backend. Several of us have been working with SmartClient for years in the past, but we are at a new company now and trying to do things better this time around.
The issue that I am looking for clarification on has to do with ListGrid and fields with a type of DateTime. The records that our server returns has date strings in the format of "2020-02-18T08:46:34". When we have a ListGrid with simple fields, let's just use one field defined as
along with an example record of
the ListGrid does not format that date properly - or better put, it does not convert it and display it as a date, it just thinks it is some string and thus shows it that way.
Reading the documentation I see that the datetime fields in a ListGrid are expecting a date object rather than a string representation of that date, so that is fair... but we are looking to find a way to do that easily to all of our records that are returned and have date values on them.
One thing we found in the SmartClient JS code is the isc.DataSource.recordsFromObjects function. This works for us, but I have personally always hesitated because it is not a documented function, and thus fear it could change at any point in time and users should not expect to get notified about it.
My question is around the idea I have outlined. Is this undocumented function a safe bet for us to use for making our records work with the ListGrid component, or is there another approach that you guys would suggest?
Any help is much appreciated. Thanks!
We are only using the JS side of the SmartClient product with a .NET backend. Several of us have been working with SmartClient for years in the past, but we are at a new company now and trying to do things better this time around.
The issue that I am looking for clarification on has to do with ListGrid and fields with a type of DateTime. The records that our server returns has date strings in the format of "2020-02-18T08:46:34". When we have a ListGrid with simple fields, let's just use one field defined as
Code:
{ name: "theDate", type: "datetime", title: "some date" }
Code:
{ theDate: "2020-02-18T08:46:34" }
Reading the documentation I see that the datetime fields in a ListGrid are expecting a date object rather than a string representation of that date, so that is fair... but we are looking to find a way to do that easily to all of our records that are returned and have date values on them.
One thing we found in the SmartClient JS code is the isc.DataSource.recordsFromObjects function. This works for us, but I have personally always hesitated because it is not a documented function, and thus fear it could change at any point in time and users should not expect to get notified about it.
My question is around the idea I have outlined. Is this undocumented function a safe bet for us to use for making our records work with the ListGrid component, or is there another approach that you guys would suggest?
Any help is much appreciated. Thanks!
Comment