All of the Web Core examples that I’ve found so far use only a TDate with no time field. But IIUC, ag-Grid also can handle TDateTime values. Is it possible currently in Web Core to use and display TDateTime values?
I guess a workaround is possible using the ValueFormatter event, but do you plan to handle new data types more directly?
This would go hand in hand with switching to a different version of the AgGrid library that the component uses underlying. We focus first on making our component work together with the current version of the library as solid, smooth & feature complete as possible first. After that, we'll consider at what point to migrate to a different version of the AgGrid library, taking changes vs new features in account.
Thanks for the explanation.
I noticed that there is a WDG.Floats[r,c] method presented by the LSP and it seems to work for storing TDateTime (Double) values in the grid, but I couldn’t figure out how to extract those numbers from the TJSValueparameter that is provided by the ValueFormatter event. Is that another possible means to work around the lack of direct TDateTime support?
This works fine:
function TForm1.WebDataGrid1Column_column1ValueFormatter(
Value: TJSValue): TJSValue;
begin
Result := FormatDateTime('dd/mm/yyyy hh:nn:ss',double(Value));
end;
procedure TForm1.WebFormCreate(Sender: TObject);
begin
webdatagrid1.ColumnDefs[0].CellDataType := cdtNumber;
webdatagrid1.InsertNewRow;
webdatagrid1.Floats[0,0] := Now;
end;
Thanks! I thought I'd tried "double(Value)", but I must have goofed it up somehow because you're right that it works fine.