Jump to content

andyhill

uniGUI Subscriber
  • Posts

    1261
  • Joined

  • Last visited

  • Days Won

    6

Posts posted by andyhill

  1. Please advise how to set UnimMemo Line Spacing in code - thanks in advance.

    I tried this but has no effect ?

      DisplayMemo.ClientEvents.ExtEvents.Clear;
      MyScript:= 'afterrender=function afterrender(sender, eOpts) '+
                 '{ '+
                 '  sender.inputEl.setStyle(''line-height'', ''26px''); '+
                 '} ';
      DisplayMemo.ClientEvents.ExtEvents.Add(MyScript);
     

    //margin-bottom: 1em;
    //line-height: 1.25;
     

  2. ...

    DBListGrid.ClientEvents.ExtEvents.Clear;
    s:= 'select=function select(sender, selected, eOpts)'#13#10+
          '{'#13#10+
          '  ajaxRequest(fMain.DBListGrid, ''_SelectedRow_'', ["row="+selected.???]);'#13#10+
          '}';
    DBListGrid.ClientEvents.ExtEvents.Add(s);

    ...

    procedure TfMain.DBListGridAjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings);
    begin

      //////////////////////////////////////////////////////////////////////////////
      if SameText(EventName, '_SelectedRow_') then begin
        SelectedRowNumber:= Params.Values['row'].ToInteger; 
      end;

    ...

  3. I have been using GoDaddy SSL Certificates without any problems but today after a Renewal the Cert fails claiming the password is wrong when it is not ?

    My ISP controls the GoDaddy generation interface - any ideas on how to get them to request the correct Cert ?

    This is my openssl request 

    openssl.exe req -new -newkey rsa:2048 -nodes -keyout key.pem -out req.csr

    Thanks in advance. 

    SSL-Error.jpg

  4. UniDBGrid1.HeaderTitle:= '';
    
    UniDBGrid1.Options:= [dgColumnResize,
                          dgColLines,
                          dgRowLines,
                          dgAutoRefreshRow
                         ];

    Can someone please show me how to Hide the Grid Header - Thanks in advance.

    Interesting find, I just added a ToolBar and the blank header disappeared.

  5. This is how I manage current and legacy applications, FqfPath is according to the required framework.

    
    procedure TUniServerModule.UniGUIServerModuleBeforeInit(Sender: TObject);
    
    ...
    
      if NonIdeFlag = True then begin
        ExtRoot:=         'FqfPath\ext-7.5.1\';
        UniRoot:=         'FqfPath\uni-1.90.0.1565\';
        UniMobileRoot:=   'FqfPath\unim-1.90.0.1565\';
      end;
    
    ...
  6. Using Bagetext I find myself needing to adjust the 'top' parameter

          '{'+
          '  sender.action = ''badgetext'';'+
          '  sender.plugins = '+
          '  ['+
          '    {'+
          '      ptype: ''badgetext'','+
          '      defaultText: 10,'+
          '      disableOpacity: 1,'+
          '      disableBg: ''blue'','+
          '      align: ''right'','+
          '      top: ''10px'','+
          '      enableBg: ''blue'''+
          '    }'+
          '  ];'+
          '}';

    My code top: '10px' is ignored, please advise how to set 'top' - thanks in advance

  7. Actually it does

    procedure TMainForm.UniButton1Click(Sender: TObject);
    Var vScript: String;
    begin
    (* NOT IN BUTTON CLICK
     vScript := 'afterrender=function afterrender(sender, eOpts) { '; // <----------
     vScript := vScript + ' Ext.create(''Ext.tip.ToolTip'', {  ';
     vScript := vScript + '   target: sender.getEl(),  ';
     vScript := vScript + '   showDelay:1,  ';
     vScript := vScript + '   dismissDelay:99999,  ';
     vScript := vScript + '   maxHeight: 600,  ';
     vScript := vScript + '   maxWidth: 800,  ';
     vScript := vScript + '   minWidth: 500,  ';
     vScript := vScript +  '   html: "<a style=''font-size:14px;''>Test com Hint</a>"  ';
     vScript := vScript + '  }); ';
     vScript := vScript + ' } ';
     UniButton1.ClientEvents.ExtEvents.Add(vScript);
    *)
    end;
    
    procedure TMainForm.UniFormCreate(Sender: TObject);
    var
      vScript: String;
    begin
     vScript := 'afterrender=function afterrender(sender, eOpts) { '; // <----------
     vScript := vScript + ' Ext.create(''Ext.tip.ToolTip'', {  ';
     vScript := vScript + '   target: sender.getEl(),  ';
     vScript := vScript + '   showDelay:1,  ';
     vScript := vScript + '   dismissDelay:99999,  ';
     vScript := vScript + '   maxHeight: 600,  ';
     vScript := vScript + '   maxWidth: 800,  ';
     vScript := vScript + '   minWidth: 500,  ';
     vScript := vScript +  '   html: "<a style=''font-size:14px;''>Test com Hint</a>"  ';
     vScript := vScript + '  }); ';
     vScript := vScript + ' } ';
     UniButton1.ClientEvents.ExtEvents.Add(vScript);                  // <----------
    end;

     

  8. This is how I would do it

    // OnSelect Event
    procedure TMainForm.UniCheckComboBox1Select(Sender: TObject);
    var
      s: String;
      i: Integer;
    begin
      s:= '';
      for i:= 0 to (Sender as TUniCheckComboBox).Items.Count-1 do begin
        if (Sender as TUniCheckComboBox).Selected[i] = True then begin
          s:= s + IntToStr(i)+': '+(Sender as TUniCheckComboBox).Items[i]+#10;
        end;
      end;
      ShowMessage(s);
    end;

     

  9. procedure TMainForm.UniFormCreate(Sender: TObject);
    var
      vScript: String;
    begin
     vScript := 'afterrender=function afterrender(sender, eOpts) { '; // <----------
     vScript := vScript + ' Ext.create(''Ext.tip.ToolTip'', {  ';
     vScript := vScript + '   target: sender.getEl(),  ';
     vScript := vScript + '   showDelay:1,  ';
     vScript := vScript + '   dismissDelay:99999,  ';
     vScript := vScript + '   maxHeight: 600,  ';
     vScript := vScript + '   maxWidth: 800,  ';
     vScript := vScript + '   minWidth: 500,  ';
     vScript := vScript +  '   html: "<a style=''font-size:14px;''>Test com Hint</a>"  ';
     vScript := vScript + '  }); ';
     vScript := vScript + ' } ';
     UniButton3.ClientEvents.ExtEvents.Add(vScript);                  // <----------
    end;

     

  10. Hundreds and hundreds of records.

    I was advised to use RowWidgets as there is no true Master/Detail Grid Option (I do not want two permanent grids always showing).

    So using RowWidgets on Expand: the Frame has SQL data, therefore if more than one Row is expanded the SQL data is only valid on the latest expand.

    This can be simply resolved by OnExpand Event closing previously expanded Row if another row was expanded.  

  11. Asking again, please advise how to Collapse ALL RowWidgets on DBGrid.

    // Collapse
    procedure TfMain.grdOutlineRowCollapse(Sender: TUniCustomDBGrid; const RowId: Integer; Container: TUniContainer);
    begin
      ExpandedID:= 0;
    end;
    
    // Expand
    procedure TfMain.grdOutlineRowExpand(Sender: TUniCustomDBGrid; const RowId: Integer; var RowControl: TControl; Container: TUniContainer);
    begin
      try
        ExpandedID:= (Sender as TUniDBGrid).DataSource.DataSet.FieldByName('OutlineID').AsInteger;
        RowControl:= TfOutlineDetail.Create(Container); 
      except
      end;
    end;
    
    // Select
    procedure TfMain.grdOutlineSelectionChange(Sender: TObject);
    var
      ChkID: Integer;
    begin
      try
        ChkID:= (Sender as TUniDBGrid).DataSource.DataSet.FieldByName('OutlineID').AsInteger;
        if ( (ExpandedID > 0) and (ChkID <> ExpandedID) ) then begin
          grdOutline.CollapseAll();
          ExpandedID:= 0;
        end;
      except
      end;
    end;

    How do I Collapse ALL RowWidgets ?

    grdOutline.CollapseAll();

     

  12. I have used this code for a long time but now need 4 Buttons instead of 3.

    At present it only paints the first 3 buttons - any ideas how to force the 4th button to be painted ? Thanks in advance

          MessageDlg(DateStr, mtConfirmation, [mbOK, mbYes, mbNo, mbAll], msgMyCallback);
          UniSession.AddJS('Ext.select("#messagebox-1001 .x-btn").elements[0].querySelectorAll(''[data-ref="btnInnerEl"]'')[0].innerHTML="One"');
          UniSession.AddJS('Ext.select("#messagebox-1001 .x-btn").elements[1].querySelectorAll(''[data-ref="btnInnerEl"]'')[0].innerHTML="Two"');
          UniSession.AddJS('Ext.select("#messagebox-1001 .x-btn").elements[2].querySelectorAll(''[data-ref="btnInnerEl"]'')[0].innerHTML="Three"');
          UniSession.AddJS('Ext.select("#messagebox-1001 .x-btn").elements[3].querySelectorAll(''[data-ref="btnInnerEl"]'')[0].innerHTML="Four"');

     

×
×
  • Create New...