Jump to content

Only errors.


picyka

Recommended Posts

 

I would like to ask for help, is there any way to improve my code so that these errors no longer occur?

Message: TUniCustomDBGrid.MoveToRow(): Unexpected Row number: 0, 4
Message: Grid is in dirty state. No more updates can be applied.


@Farshad Mohajeri

Thank you for any tip.

Link to comment
Share on other sites

  • Administrators
52 minutes ago, picyka said:

 

I would like to ask for help, is there any way to improve my code so that these errors no longer occur?

Message: TUniCustomDBGrid.MoveToRow(): Unexpected Row number: 0, 4
Message: Grid is in dirty state. No more updates can be applied.


@Farshad Mohajeri

Thank you for any tip.

Hi,

We have done several modifications in recent versions so these errors must be very rare.

If you can send us a test case which can reproduce these bugs we will happy to look into it.

Link to comment
Share on other sites

Well, the first message I can simulate on my system, the second I never managed to do, I already received a print from the user, but these are very random cases.

1) Basically there I have a grid that can be searched by columns, in the last column, I have a UniCheckComboBox, where the user can select one or more values.

Error image attached, I can even try to do a test case later.

Error.png

Link to comment
Share on other sites

unit uniDBGrid;
function SetCurrentRowCol(ARow, ACol:Integer; SuppParams: array of string):Boolean; override;
 

It seems that it tries to select the line and is processing the filter, which ends up causing the error, I don't know if I'm quite sure about this theory.

LineError.PNG

Link to comment
Share on other sites

Component: UniDBGridServicos (TUniDBGrid)
Parent: UniFrameCadFornecedor0
LastAjaxEvent: actionclick
Class: Exception
Message: TUniCustomDBGrid.MoveToRow(): Unexpected Row number: 2, 3

Version: 1573

 

Link to comment
Share on other sites

I'll help you simulate the error very easily.

 

procedure TMainForm.UniDBGrid1ColumnFilter(Sender: TUniDBGrid; const Column: TUniDBGridColumn; const Value: Variant);
begin
  if Column.FieldName = 'LOG_UF' then
  begin
    CDCadastro.Filtered := False;
    if Value <> '' then
    begin
      var lFiltro := '';
      if VarToStr(Value).Contains(';') then
        lFiltro := 'SC'
      else
        lFiltro := VarToStr(Value);

      Sleep(1000);

      CDCadastro.Filter := 'LOG_UF=' + QuotedStr(lFiltro);
      CDCadastro.Filtered := True;
    end;
  end;
end;

Sleep(1000);

In my production system, the error occurs more easily than in the demo, because there is a small delay in loading the data. so I put a Sleep(1000); After selecting the SC value, click very quickly on more than one line.

 @Farshad Mohajeri

Link to comment
Share on other sites

I never use SLEEP, instead use ajaxrequest with delay.

...

    UniSession.AddJS('Ext.defer(function() {ajaxRequest(MainForm.window, ''_SetFilter_'', [])}, 300);');
 
...

procedure TMainForm.UniFormAjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings);
begin

  if SameText('_SetFilter_', EventName) then begin 

...

Link to comment
Share on other sites

19 minutos atrás, andyhill disse:

Eu nunca uso SLEEP, em vez disso uso ajaxrequest com atraso.

...

UniSession.AddJS('Ext.defer(function() {ajaxRequest(MainForm.window, ''_SetFilter_'', [])}, 300);');

...

procedimento TMainForm.UniFormAjaxEvent(Remetente: TComponent; EventName: cadeia de caracteres; Params: TUniStrings);
começar

se SameText('_SetFilter_', EventName) então comece

...

I believe that no one should use SLEEP there anyway, it was just a way to simulate a delay when loading the data.

Link to comment
Share on other sites

From the tests I did, I understood that errors can happen at times. ActionClick for example,
if the user clicks on an action, and there is no mask there, for some reason there may be a delay in processing,
if the user changes the grid lines the error will also occur. There in the example,
I put a Sleep(1000) just to simulate a delay in loading the data. I don't know how to solve this,
but I believe that the filter event mask should be activated when the filter is selected, blocking the grid so the user cannot do anything.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...