Jump to content

Error "Grid is in dirty state. No more updates can be applied"


masterdeveloper

Recommended Posts

Good afternoon everyone

 

I'm using a grid problem, where when I select a record, it returns the following error message: "Grid is in dirty state. No more updates can be applied."

 

 

The grid is simple, and has no special behavior.

 

 

The error happens the moment the checkbox is clicked to select the record in the grid.

 

 

 

 

 

 

 

Link to comment
Share on other sites

  • 4 months later...
Good afternoon, we updated to the latest version uni-1.50.0.1479 and the problem persists.

I believe the problem is in the procedure:

 

procedure TUniCustomDBGrid.H_OnDataLoaded (This: TJSObject; EventName: string; Params: TUniStrings);

var

  DoRst: Boolean;

  dts: TDataSet;

begin

  ClearGridDirtyState (True);

  FLoadDataStarted: = False;

  FGridDirty: = False; <<< -------------

...

 

This event is not called on my grid a few times.

Apparently it is falling into this procedure "TUniCustomDBGrid.SetCellValue" before falling into this procedure "TUniCustomDBGrid.H_OnDataLoaded". That way the FGridDirty variable is not updated in time.

 

In the event: procedure TUniCustomDBGrid.LoadDataX is set to the variable value:

 


procedure TUniCustomDBGrid.LoadDataX;

begin

  if FGridLoadRec.Dirty then

  begin

    FGridLoadRec.Dirty := False;

    FGridDirty := True;

...

 


but this variable does not get "False" BEFORE entering the procedure "TUniCustomDBGrid.SetCellValue", this procedure is called AFTER passing the procedure "TUniCustomDBGrid.SetCellValue".

 

 

Summarizing the problem that happens on my grid:

 

1- When selecting a record in the grid, the procedure TUniCustomDBGrid.LoadDataX; is called

2- This procedure points to the value of the variable FGridDirty: = True;

3- The procedure TUniCustomDBGrid.H_OnDataLoaded should now be called, but it is not

4- The value of the FGridDirty variable is false

5- The procedure procedure TUniCustomDBGrid.SetCellValue is called

6- Validation happens and aborts processing:

 

          if FGridDirty then

            raise Exception.Create ('Grid is in dirty state. No more updates can be applied.');

 

7- After the error appears, the procedure "TUniCustomDBGrid.H_OnDataLoaded" is called, it seems to me that it has a delay.

 


Note: The field I select on the grid is of type "CheckboxField". I believe that:

When the field is of type "Checkboxfield", when opening the grid and marking this field first (without selecting the line), the procedure "TUniCustomDBGrid.H_OnDataLoaded" is not called. If you select the line, then mark the checkbox, the procedure is called correctly.


 

I could not simulate this situation in a test case, it only occurs in my application. Any tips?

 

Thank you.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...