Jump to content

picyka

uniGUI Subscriber
  • Posts

    1079
  • Joined

  • Last visited

  • Days Won

    34

Posts posted by picyka

  1. 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.

  2. 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.

  3. 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

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

     

  5. 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

  6. 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

  7.  

    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.

  8. On 4/18/2024 at 5:11 PM, Luciano França said:

    I have several settings that I save in my database such as font sizes, colors, etc.
    How could I give an update on
    "CustomCSS" because I realize that it is only loaded when creating the "TUniServerModule"

    Unit ServerModule;
    
    public
      { Public declarations }
      Procedure UpdateCSS;
     End;
    
    Procedure TUniServerModule.UpdateCSS;
    Begin
     With Self.customCSS Do Begin
      Add('.x-myfield-focus {  ');
      Add('   border-color: #7eadd9;  ');
      Add('  background-color: #FFFFE1;  ');
      Add('  color: #FF0000;  ');
      Add('  background-image: none;  ');
      Add(' } ');
     End;
    End;
    
    //============================================================================================================
    
    Unit Main;
    procedure TMainForm.UniFormCreate(Sender: TObject);
    begin
     UniServerModule.UpdateCSS;
    
     UniEdit2.JSInterface.JSConfig('focusCls', ['myfield-focus']);
     UniComboBox1.JSInterface.JSConfig('focusCls', ['myfield-focus']);
    end;

     

     

    UniSession.AddJS('Ext.util.CSS.updateRule(''.x-myfield-focus'', ''background-color'', ''#162d3f'')');

     

  9. Well, I believe you can use variables in CSS, and when logging into the system, set the value for these variables, or use the suggested solution

    ex: UniSession.AddJS('Ext.util.CSS.updateRule(''.x-btn-default-small'', ''background-color'', ''#162d3f'')');

     

×
×
  • Create New...