WEB Core / TWebDBGrid / 1.7.0.1

Dear Sirs,

Delphi 10.4.2 Sydney
Web Core 1.7.0.1 (full)

See attached project WebCoreBugDBGrid.zip (379.3 KB)

DateTimeEditor
Do you have any plans to enable grid embeded editor for datetime values (as in both at the same time)?

Change value programmatically after insert


You can click on button "Problem 1" or use navigator to trigger insert, then we edit any dataset field programmatically. The result is displayed in image.
As the operation is insert (not append) we would expect record to be inserted in-place (before) current record. Changing current record field value after that would then probably not cause any issues as the active record of grid and dataset would be the same.

Using inplace editors on non active record.


For example when we edit checkbox embeded editor on a different record than current record. The grid does not change active record. As a result we are editing wrong record.

Increasing delay in processing user/gui events


This problem is a bit harder to explain. It requires that you first trigger refresh multiple times (30 times). After that a single click on any control will take about 1s or more. Point is the whole web application is slowed down every time grid rebuilds its content.
It helps a bit if we detach the grid datasource before re-opening the dataset. The application will slow down regardless if we click refresh enough times. You will notice there is an increasing delay in how user events are processed (such as clicking on a button). The execution is not delayed just the triggering. The slowdown persists event if you destroy the form. Only F5 helps.

Triggering of Dataset.OnCalcFields event
4_problem
In relation to opening a dataset connected to grid. The DatasetOnCalcFields is triggered quite a lot. Can this be reduced in any way (workaround in code maybe)? If it triggers once it would be enough because it is linked to dataset not fields.

Kind Regards

Delphi 10.4.2 Sydney
Web Core 1.7.1.0 (full) 4.5.2021

Grid date time format settings change
We noticed a change in default date time formating in grid and inherent problem with embeded editor for time fields. The grid value is not read properly as it displays empty value in editor.

Kind Regards

Delphi 10.4.2 Sydney
Web Core 1.7.2.0 (full)

This patch is another disappointment. Problems are not solved.

DateTimeEditor. - not implemented, no reply

Change value programmatically after insert. - problem not solved

Using inplace editors on non active record. - problem not solved

Increasing delay in processing user/gui events - problem worsening
Click "Reset" multiple times to experience massive slowdowns.

Triggering of Dataset.OnCalcFields event - not improved, no reply

Grid date time format settings change - problem not solved

Delphi 10.4.2 Sydney
Web Core 1.7.3.0 (full)

New patch - no changes.

Is there a way to control when embeded checkbox editor is allowed to change field value?

CanEditCell event is natural choice but it is not triggered and it does not block the operation. The value is changed regardless.

Kind Regards

Delphi 10.4.2 Sydney
Web Core 1.7.3.0 (full)

Increasing delay in processing user/gui events - problem worsening

Attached images show Chrome performance report where event listeners are being added with each time grid reloads ints data (if you close and open dataset for example).

We diagnosed this problem to be a consequence of "event leak":
Not removing MouseMove and MouseUp event listeners from Grid when its cells are cleared. More and more events are added each time a cell is changed internally. See TMSStringGridresizableGrid for more details. Specifically these lines of code add event listeners and removing them (for testing purposes only) makes this problem go away:
' document.addEventListener("mousemove", function (e) {'+
' TMSStringGridresizeColumn(e);'+
' });'+

' document.addEventListener("mouseup", function (e) {'+
' TMSStringGridresetResize();'+
' });'+

Please make adjustments in core library as this problem destroys any TMS Web Core application that uses TWebDBGrid.

Kind Regards

Delphi 10.4.2 Sydney
Web Core 1.7.3.0 (full)

Editing a filtered dataset connected to db grid does not work. The dataset state is reverted back to browse mode immediately after editing current row (via embeded editors or by code).

An example how we use filtering:

procedure TfrmGrid.DatasetOnFilterRecord(DataSet: TDataSet; var Accept: Boolean);
begin
Accept := (DataSet.FieldByName('id').AsInteger = 2);
end;

procedure TfrmGrid.SetupForm();
...
cdMain.OnFilterRecord := DatasetOnFilterRecord;
cdMain.Filtered := True;

And then try to edit a value in any of columns. The value is reverted back everytime.

Kind Regards